comparison libiberty/functions.texi @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents 77e2b8dfacca
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1 @c Automatically generated from *.c and others (the comments before 1 @c Automatically generated from *.c and others (the comments before
2 @c each entry tell you which file and where in that file). DO NOT EDIT! 2 @c each entry tell you which file and where in that file). DO NOT EDIT!
3 @c Edit the *.c files, configure with --enable-maintainer-mode, 3 @c Edit the *.c files, configure with --enable-maintainer-mode,
4 @c run 'make stamp-functions' and gather-docs will build a new copy. 4 @c run 'make stamp-functions' and gather-docs will build a new copy.
5
6 @c safe-ctype.c:25
7 @defvr Extension HOST_CHARSET
8 This macro indicates the basic character set and encoding used by the
9 host: more precisely, the encoding used for character constants in
10 preprocessor @samp{#if} statements (the C "execution character set").
11 It is defined by @file{safe-ctype.h}, and will be an integer constant
12 with one of the following values:
13
14 @ftable @code
15 @item HOST_CHARSET_UNKNOWN
16 The host character set is unknown - that is, not one of the next two
17 possibilities.
18
19 @item HOST_CHARSET_ASCII
20 The host character set is ASCII.
21
22 @item HOST_CHARSET_EBCDIC
23 The host character set is some variant of EBCDIC. (Only one of the
24 nineteen EBCDIC varying characters is tested; exercise caution.)
25 @end ftable
26 @end defvr
27 5
28 @c alloca.c:26 6 @c alloca.c:26
29 @deftypefn Replacement void* alloca (size_t @var{size}) 7 @deftypefn Replacement void* alloca (size_t @var{size})
30 8
31 This function allocates memory which will be automatically reclaimed 9 This function allocates memory which will be automatically reclaimed
89 @var{out}. The use of @code{bcopy} is deprecated in new programs. 67 @var{out}. The use of @code{bcopy} is deprecated in new programs.
90 68
91 @end deftypefn 69 @end deftypefn
92 70
93 @c bsearch.c:33 71 @c bsearch.c:33
94 @deftypefn Supplemental void* bsearch (const void *@var{key}, const void *@var{base}, size_t @var{nmemb}, size_t @var{size}, int (*@var{compar})(const void *, const void *)) 72 @deftypefn Supplemental void* bsearch (const void *@var{key}, @
73 const void *@var{base}, size_t @var{nmemb}, size_t @var{size}, @
74 int (*@var{compar})(const void *, const void *))
95 75
96 Performs a search over an array of @var{nmemb} elements pointed to by 76 Performs a search over an array of @var{nmemb} elements pointed to by
97 @var{base} for a member that matches the object pointed to by @var{key}. 77 @var{base} for a member that matches the object pointed to by @var{key}.
98 The size of each member is specified by @var{size}. The array contents 78 The size of each member is specified by @var{size}. The array contents
99 should be sorted in ascending order according to the @var{compar} 79 should be sorted in ascending order according to the @var{compar}
156 This function is provided for backwards compatibility only. Its use is 136 This function is provided for backwards compatibility only. Its use is
157 not recommended. 137 not recommended.
158 138
159 @end deftypefn 139 @end deftypefn
160 140
161 @c make-temp-file.c:95 141 @c make-temp-file.c:96
162 @deftypefn Replacement char* choose_tmpdir () 142 @deftypefn Replacement char* choose_tmpdir ()
163 143
164 Returns a pointer to a directory path suitable for creating temporary 144 Returns a pointer to a directory path suitable for creating temporary
165 files in. 145 files in.
166 146
174 number of seconds used. 154 number of seconds used.
175 155
176 @end deftypefn 156 @end deftypefn
177 157
178 @c concat.c:24 158 @c concat.c:24
179 @deftypefn Extension char* concat (const char *@var{s1}, const char *@var{s2}, @dots{}, @code{NULL}) 159 @deftypefn Extension char* concat (const char *@var{s1}, const char *@var{s2}, @
160 @dots{}, @code{NULL})
180 161
181 Concatenate zero or more of strings and return the result in freshly 162 Concatenate zero or more of strings and return the result in freshly
182 @code{xmalloc}ed memory. Returns @code{NULL} if insufficient memory is 163 @code{xmalloc}ed memory. Returns @code{NULL} if insufficient memory is
183 available. The argument list is terminated by the first @code{NULL} 164 available. The argument list is terminated by the first @code{NULL}
184 pointer encountered. Pointers to empty strings are ignored. 165 pointer encountered. Pointers to empty strings are ignored.
185 166
186 @end deftypefn 167 @end deftypefn
187 168
188 @c crc32.c:141 169 @c crc32.c:141
189 @deftypefn Extension unsigned int crc32 (const unsigned char *@var{buf}, int @var{len}, unsigned int @var{init}) 170 @deftypefn Extension {unsigned int} crc32 (const unsigned char *@var{buf}, @
171 int @var{len}, unsigned int @var{init})
190 172
191 Compute the 32-bit CRC of @var{buf} which has length @var{len}. The 173 Compute the 32-bit CRC of @var{buf} which has length @var{len}. The
192 starting value is @var{init}; this may be used to compute the CRC of 174 starting value is @var{init}; this may be used to compute the CRC of
193 data split across multiple buffers by passing the return value of each 175 data split across multiple buffers by passing the return value of each
194 call as the @var{init} parameter of the next. 176 call as the @var{init} parameter of the next.
275 for a match, which is done by comparing major and minor device numbers 257 for a match, which is done by comparing major and minor device numbers
276 and inode numbers. 258 and inode numbers.
277 259
278 @end deftypefn 260 @end deftypefn
279 261
280 @c fopen_unlocked.c:48 262 @c fopen_unlocked.c:49
281 @deftypefn Extension {FILE *} fdopen_unlocked (int @var{fildes}, const char * @var{mode}) 263 @deftypefn Extension {FILE *} fdopen_unlocked (int @var{fildes}, @
264 const char * @var{mode})
282 265
283 Opens and returns a @code{FILE} pointer via @code{fdopen}. If the 266 Opens and returns a @code{FILE} pointer via @code{fdopen}. If the
284 operating system supports it, ensure that the stream is setup to avoid 267 operating system supports it, ensure that the stream is setup to avoid
285 any multi-threaded locking. Otherwise return the @code{FILE} pointer 268 any multi-threaded locking. Otherwise return the @code{FILE} pointer
286 unchanged. 269 unchanged.
311 However, it does handle the fact that on DOS-like file systems, forward 294 However, it does handle the fact that on DOS-like file systems, forward
312 and backward slashes are equal. 295 and backward slashes are equal.
313 296
314 @end deftypefn 297 @end deftypefn
315 298
299 @c filename_cmp.c:81
300 @deftypefn Extension int filename_ncmp (const char *@var{s1}, const char *@var{s2}, size_t @var{n})
301
302 Return zero if the two file names @var{s1} and @var{s2} are equivalent
303 in range @var{n}.
304 If not equivalent, the returned value is similar to what @code{strncmp}
305 would return. In other words, it returns a negative value if @var{s1}
306 is less than @var{s2}, or a positive value if @var{s2} is greater than
307 @var{s2}.
308
309 This function does not normalize file names. As a result, this function
310 will treat filenames that are spelled differently as different even in
311 the case when the two filenames point to the same underlying file.
312 However, it does handle the fact that on DOS-like file systems, forward
313 and backward slashes are equal.
314
315 @end deftypefn
316
316 @c fnmatch.txh:1 317 @c fnmatch.txh:1
317 @deftypefn Replacement int fnmatch (const char *@var{pattern}, const char *@var{string}, int @var{flags}) 318 @deftypefn Replacement int fnmatch (const char *@var{pattern}, @
319 const char *@var{string}, int @var{flags})
318 320
319 Matches @var{string} against @var{pattern}, returning zero if it 321 Matches @var{string} against @var{pattern}, returning zero if it
320 matches, @code{FNM_NOMATCH} if not. @var{pattern} may contain the 322 matches, @code{FNM_NOMATCH} if not. @var{pattern} may contain the
321 wildcards @code{?} to match any one character, @code{*} to match any 323 wildcards @code{?} to match any one character, @code{*} to match any
322 zero or more characters, or a set of alternate characters in square 324 zero or more characters, or a set of alternate characters in square
362 @end table 364 @end table
363 365
364 @end deftypefn 366 @end deftypefn
365 367
366 @c fopen_unlocked.c:39 368 @c fopen_unlocked.c:39
367 @deftypefn Extension {FILE *} fopen_unlocked (const char *@var{path}, const char * @var{mode}) 369 @deftypefn Extension {FILE *} fopen_unlocked (const char *@var{path}, @
370 const char * @var{mode})
368 371
369 Opens and returns a @code{FILE} pointer via @code{fopen}. If the 372 Opens and returns a @code{FILE} pointer via @code{fopen}. If the
370 operating system supports it, ensure that the stream is setup to avoid 373 operating system supports it, ensure that the stream is setup to avoid
371 any multi-threaded locking. Otherwise return the @code{FILE} pointer 374 any multi-threaded locking. Otherwise return the @code{FILE} pointer
372 unchanged. 375 unchanged.
381 the terminating @code{NULL} is found, and then frees @var{vector} 384 the terminating @code{NULL} is found, and then frees @var{vector}
382 itself. 385 itself.
383 386
384 @end deftypefn 387 @end deftypefn
385 388
386 @c fopen_unlocked.c:57 389 @c fopen_unlocked.c:59
387 @deftypefn Extension {FILE *} freopen_unlocked (const char * @var{path}, const char * @var{mode}, FILE * @var{stream}) 390 @deftypefn Extension {FILE *} freopen_unlocked (const char * @var{path}, @
391 const char * @var{mode}, FILE * @var{stream})
388 392
389 Opens and returns a @code{FILE} pointer via @code{freopen}. If the 393 Opens and returns a @code{FILE} pointer via @code{freopen}. If the
390 operating system supports it, ensure that the stream is setup to avoid 394 operating system supports it, ensure that the stream is setup to avoid
391 any multi-threaded locking. Otherwise return the @code{FILE} pointer 395 any multi-threaded locking. Otherwise return the @code{FILE} pointer
392 unchanged. 396 unchanged.
475 converted to a wider unsigned type --- like @code{bfd_vma}, on some 479 converted to a wider unsigned type --- like @code{bfd_vma}, on some
476 systems. 480 systems.
477 481
478 @end deftypefn 482 @end deftypefn
479 483
484 @c safe-ctype.c:25
485 @defvr Extension HOST_CHARSET
486 This macro indicates the basic character set and encoding used by the
487 host: more precisely, the encoding used for character constants in
488 preprocessor @samp{#if} statements (the C "execution character set").
489 It is defined by @file{safe-ctype.h}, and will be an integer constant
490 with one of the following values:
491
492 @ftable @code
493 @item HOST_CHARSET_UNKNOWN
494 The host character set is unknown - that is, not one of the next two
495 possibilities.
496
497 @item HOST_CHARSET_ASCII
498 The host character set is ASCII.
499
500 @item HOST_CHARSET_EBCDIC
501 The host character set is some variant of EBCDIC. (Only one of the
502 nineteen EBCDIC varying characters is tested; exercise caution.)
503 @end ftable
504 @end defvr
505
506 @c hashtab.c:336
507 @deftypefn Supplemental htab_t htab_create_typed_alloc (size_t @var{size}, @
508 htab_hash @var{hash_f}, htab_eq @var{eq_f}, htab_del @var{del_f}, @
509 htab_alloc @var{alloc_tab_f}, htab_alloc @var{alloc_f}, @
510 htab_free @var{free_f})
511
512 This function creates a hash table that uses two different allocators
513 @var{alloc_tab_f} and @var{alloc_f} to use for allocating the table itself
514 and its entries respectively. This is useful when variables of different
515 types need to be allocated with different allocators.
516
517 The created hash table is slightly larger than @var{size} and it is
518 initially empty (all the hash table entries are @code{HTAB_EMPTY_ENTRY}).
519 The function returns the created hash table, or @code{NULL} if memory
520 allocation fails.
521
522 @end deftypefn
523
480 @c index.c:5 524 @c index.c:5
481 @deftypefn Supplemental char* index (char *@var{s}, int @var{c}) 525 @deftypefn Supplemental char* index (char *@var{s}, int @var{c})
482 526
483 Returns a pointer to the first occurrence of the character @var{c} in 527 Returns a pointer to the first occurrence of the character @var{c} in
484 the string @var{s}, or @code{NULL} if not found. The use of @code{index} is 528 the string @var{s}, or @code{NULL} if not found. The use of @code{index} is
485 deprecated in new programs in favor of @code{strchr}. 529 deprecated in new programs in favor of @code{strchr}.
486 530
487 @end deftypefn 531 @end deftypefn
488 532
489 @c insque.c:6 533 @c insque.c:6
490 @deftypefn Supplemental void insque (struct qelem *@var{elem}, struct qelem *@var{pred}) 534 @deftypefn Supplemental void insque (struct qelem *@var{elem}, @
535 struct qelem *@var{pred})
491 @deftypefnx Supplemental void remque (struct qelem *@var{elem}) 536 @deftypefnx Supplemental void remque (struct qelem *@var{elem})
492 537
493 Routines to manipulate queues built from doubly linked lists. The 538 Routines to manipulate queues built from doubly linked lists. The
494 @code{insque} routine inserts @var{elem} in the queue immediately 539 @code{insque} routine inserts @var{elem} in the queue immediately
495 after @var{pred}. The @code{remque} routine removes @var{elem} from 540 after @var{pred}. The @code{remque} routine removes @var{elem} from
604 @code{malloc}, or @code{NULL} will be returned on a memory allocation error. 649 @code{malloc}, or @code{NULL} will be returned on a memory allocation error.
605 650
606 @end deftypefn 651 @end deftypefn
607 652
608 @c make-relative-prefix.c:24 653 @c make-relative-prefix.c:24
609 @deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix}) 654 @deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, @
655 const char *@var{bin_prefix}, const char *@var{prefix})
610 656
611 Given three paths @var{progname}, @var{bin_prefix}, @var{prefix}, 657 Given three paths @var{progname}, @var{bin_prefix}, @var{prefix},
612 return the path that is in the same position relative to 658 return the path that is in the same position relative to
613 @var{progname}'s directory as @var{prefix} is relative to 659 @var{progname}'s directory as @var{prefix} is relative to
614 @var{bin_prefix}. That is, a string starting with the directory 660 @var{bin_prefix}. That is, a string starting with the directory
628 The return value is normally allocated via @code{malloc}. If no 674 The return value is normally allocated via @code{malloc}. If no
629 relative prefix can be found, return @code{NULL}. 675 relative prefix can be found, return @code{NULL}.
630 676
631 @end deftypefn 677 @end deftypefn
632 678
633 @c make-temp-file.c:168 679 @c make-temp-file.c:174
634 @deftypefn Replacement char* make_temp_file (const char *@var{suffix}) 680 @deftypefn Replacement char* make_temp_file (const char *@var{suffix})
635 681
636 Return a temporary file name (as a string) or @code{NULL} if unable to 682 Return a temporary file name (as a string) or @code{NULL} if unable to
637 create one. @var{suffix} is a suffix to append to the file name. The 683 create one. @var{suffix} is a suffix to append to the file name. The
638 string is @code{malloc}ed, and the temporary file has been created. 684 string is @code{malloc}ed, and the temporary file has been created.
639 685
640 @end deftypefn 686 @end deftypefn
641 687
642 @c memchr.c:3 688 @c memchr.c:3
643 @deftypefn Supplemental void* memchr (const void *@var{s}, int @var{c}, size_t @var{n}) 689 @deftypefn Supplemental void* memchr (const void *@var{s}, int @var{c}, @
690 size_t @var{n})
644 691
645 This function searches memory starting at @code{*@var{s}} for the 692 This function searches memory starting at @code{*@var{s}} for the
646 character @var{c}. The search only ends with the first occurrence of 693 character @var{c}. The search only ends with the first occurrence of
647 @var{c}, or after @var{length} characters; in particular, a null 694 @var{c}, or after @var{length} characters; in particular, a null
648 character does not terminate the search. If the character @var{c} is 695 character does not terminate the search. If the character @var{c} is
651 returned. 698 returned.
652 699
653 @end deftypefn 700 @end deftypefn
654 701
655 @c memcmp.c:6 702 @c memcmp.c:6
656 @deftypefn Supplemental int memcmp (const void *@var{x}, const void *@var{y}, size_t @var{count}) 703 @deftypefn Supplemental int memcmp (const void *@var{x}, const void *@var{y}, @
704 size_t @var{count})
657 705
658 Compares the first @var{count} bytes of two areas of memory. Returns 706 Compares the first @var{count} bytes of two areas of memory. Returns
659 zero if they are the same, a value less than zero if @var{x} is 707 zero if they are the same, a value less than zero if @var{x} is
660 lexically less than @var{y}, or a value greater than zero if @var{x} 708 lexically less than @var{y}, or a value greater than zero if @var{x}
661 is lexically greater than @var{y}. Note that lexical order is determined 709 is lexically greater than @var{y}. Note that lexical order is determined
662 as if comparing unsigned char arrays. 710 as if comparing unsigned char arrays.
663 711
664 @end deftypefn 712 @end deftypefn
665 713
666 @c memcpy.c:6 714 @c memcpy.c:6
667 @deftypefn Supplemental void* memcpy (void *@var{out}, const void *@var{in}, size_t @var{length}) 715 @deftypefn Supplemental void* memcpy (void *@var{out}, const void *@var{in}, @
716 size_t @var{length})
668 717
669 Copies @var{length} bytes from memory region @var{in} to region 718 Copies @var{length} bytes from memory region @var{in} to region
670 @var{out}. Returns a pointer to @var{out}. 719 @var{out}. Returns a pointer to @var{out}.
671 720
672 @end deftypefn 721 @end deftypefn
673 722
674 @c memmem.c:20 723 @c memmem.c:20
675 @deftypefn Supplemental void* memmem (const void *@var{haystack}, size_t @var{haystack_len} const void *@var{needle}, size_t @var{needle_len}) 724 @deftypefn Supplemental void* memmem (const void *@var{haystack}, @
725 size_t @var{haystack_len} const void *@var{needle}, size_t @var{needle_len})
676 726
677 Returns a pointer to the first occurrence of @var{needle} (length 727 Returns a pointer to the first occurrence of @var{needle} (length
678 @var{needle_len}) in @var{haystack} (length @var{haystack_len}). 728 @var{needle_len}) in @var{haystack} (length @var{haystack_len}).
679 Returns @code{NULL} if not found. 729 Returns @code{NULL} if not found.
680 730
681 @end deftypefn 731 @end deftypefn
682 732
683 @c memmove.c:6 733 @c memmove.c:6
684 @deftypefn Supplemental void* memmove (void *@var{from}, const void *@var{to}, size_t @var{count}) 734 @deftypefn Supplemental void* memmove (void *@var{from}, const void *@var{to}, @
735 size_t @var{count})
685 736
686 Copies @var{count} bytes from memory area @var{from} to memory area 737 Copies @var{count} bytes from memory area @var{from} to memory area
687 @var{to}, returning a pointer to @var{to}. 738 @var{to}, returning a pointer to @var{to}.
688 739
689 @end deftypefn 740 @end deftypefn
690 741
691 @c mempcpy.c:23 742 @c mempcpy.c:23
692 @deftypefn Supplemental void* mempcpy (void *@var{out}, const void *@var{in}, size_t @var{length}) 743 @deftypefn Supplemental void* mempcpy (void *@var{out}, const void *@var{in}, @
744 size_t @var{length})
693 745
694 Copies @var{length} bytes from memory region @var{in} to region 746 Copies @var{length} bytes from memory region @var{in} to region
695 @var{out}. Returns a pointer to @var{out} + @var{length}. 747 @var{out}. Returns a pointer to @var{out} + @var{length}.
696 748
697 @end deftypefn 749 @end deftypefn
698 750
699 @c memset.c:6 751 @c memset.c:6
700 @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count}) 752 @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, @
753 size_t @var{count})
701 754
702 Sets the first @var{count} bytes of @var{s} to the constant byte 755 Sets the first @var{count} bytes of @var{s} to the constant byte
703 @var{c}, returning a pointer to @var{s}. 756 @var{c}, returning a pointer to @var{s}.
704 757
705 @end deftypefn 758 @end deftypefn
720 filename unique. Returns a file descriptor open on the file for 773 filename unique. Returns a file descriptor open on the file for
721 reading and writing. 774 reading and writing.
722 775
723 @end deftypefn 776 @end deftypefn
724 777
725 @c pexecute.txh:266 778 @c pexecute.txh:278
726 @deftypefn Extension void pex_free (struct pex_obj @var{obj}) 779 @deftypefn Extension void pex_free (struct pex_obj @var{obj})
727 780
728 Clean up and free all data associated with @var{obj}. If you have not 781 Clean up and free all data associated with @var{obj}. If you have not
729 yet called @code{pex_get_times} or @code{pex_get_status}, this will 782 yet called @code{pex_get_times} or @code{pex_get_status}, this will
730 try to kill the subprocesses. 783 try to kill the subprocesses.
731 784
732 @end deftypefn 785 @end deftypefn
733 786
734 @c pexecute.txh:241 787 @c pexecute.txh:251
735 @deftypefn Extension int pex_get_status (struct pex_obj *@var{obj}, int @var{count}, int *@var{vector}) 788 @deftypefn Extension int pex_get_status (struct pex_obj *@var{obj}, @
789 int @var{count}, int *@var{vector})
736 790
737 Returns the exit status of all programs run using @var{obj}. 791 Returns the exit status of all programs run using @var{obj}.
738 @var{count} is the number of results expected. The results will be 792 @var{count} is the number of results expected. The results will be
739 placed into @var{vector}. The results are in the order of the calls 793 placed into @var{vector}. The results are in the order of the calls
740 to @code{pex_run}. Returns 0 on error, 1 on success. 794 to @code{pex_run}. Returns 0 on error, 1 on success.
741 795
742 @end deftypefn 796 @end deftypefn
743 797
744 @c pexecute.txh:250 798 @c pexecute.txh:261
745 @deftypefn Extension int pex_get_times (struct pex_obj *@var{obj}, int @var{count}, struct pex_time *@var{vector}) 799 @deftypefn Extension int pex_get_times (struct pex_obj *@var{obj}, @
800 int @var{count}, struct pex_time *@var{vector})
746 801
747 Returns the process execution times of all programs run using 802 Returns the process execution times of all programs run using
748 @var{obj}. @var{count} is the number of results expected. The 803 @var{obj}. @var{count} is the number of results expected. The
749 results will be placed into @var{vector}. The results are in the 804 results will be placed into @var{vector}. The results are in the
750 order of the calls to @code{pex_run}. Returns 0 on error, 1 on 805 order of the calls to @code{pex_run}. Returns 0 on error, 1 on
757 process times, all the fields will be set to @code{0}. 812 process times, all the fields will be set to @code{0}.
758 813
759 @end deftypefn 814 @end deftypefn
760 815
761 @c pexecute.txh:2 816 @c pexecute.txh:2
762 @deftypefn Extension {struct pex_obj *} pex_init (int @var{flags}, const char *@var{pname}, const char *@var{tempbase}) 817 @deftypefn Extension {struct pex_obj *} pex_init (int @var{flags}, @
818 const char *@var{pname}, const char *@var{tempbase})
763 819
764 Prepare to execute one or more programs, with standard output of each 820 Prepare to execute one or more programs, with standard output of each
765 program fed to standard input of the next. This is a system 821 program fed to standard input of the next. This is a system
766 independent interface to execute a pipeline. 822 independent interface to execute a pipeline.
767 823
788 messages. @var{tempbase} is a base name to use for any required 844 messages. @var{tempbase} is a base name to use for any required
789 temporary files; it may be @code{NULL} to use a randomly chosen name. 845 temporary files; it may be @code{NULL} to use a randomly chosen name.
790 846
791 @end deftypefn 847 @end deftypefn
792 848
793 @c pexecute.txh:155 849 @c pexecute.txh:161
794 @deftypefn Extension {FILE *} pex_input_file (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{in_name}) 850 @deftypefn Extension {FILE *} pex_input_file (struct pex_obj *@var{obj}, @
851 int @var{flags}, const char *@var{in_name})
795 852
796 Return a stream for a temporary file to pass to the first program in 853 Return a stream for a temporary file to pass to the first program in
797 the pipeline as input. 854 the pipeline as input.
798 855
799 The name of the input file is chosen according to the same rules 856 The name of the input file is chosen according to the same rules
806 If @var{flags} includes @code{PEX_BINARY_OUTPUT}, open the stream in 863 If @var{flags} includes @code{PEX_BINARY_OUTPUT}, open the stream in
807 binary mode; otherwise, open it in the default mode. Including 864 binary mode; otherwise, open it in the default mode. Including
808 @code{PEX_BINARY_OUTPUT} in @var{flags} has no effect on Unix. 865 @code{PEX_BINARY_OUTPUT} in @var{flags} has no effect on Unix.
809 @end deftypefn 866 @end deftypefn
810 867
811 @c pexecute.txh:172 868 @c pexecute.txh:179
812 @deftypefn Extension {FILE *} pex_input_pipe (struct pex_obj *@var{obj}, int @var{binary}) 869 @deftypefn Extension {FILE *} pex_input_pipe (struct pex_obj *@var{obj}, @
870 int @var{binary})
813 871
814 Return a stream @var{fp} for a pipe connected to the standard input of 872 Return a stream @var{fp} for a pipe connected to the standard input of
815 the first program in the pipeline; @var{fp} is opened for writing. 873 the first program in the pipeline; @var{fp} is opened for writing.
816 You must have passed @code{PEX_USE_PIPES} to the @code{pex_init} call 874 You must have passed @code{PEX_USE_PIPES} to the @code{pex_init} call
817 that returned @var{obj}. 875 that returned @var{obj}.
851 909
852 @end itemize 910 @end itemize
853 911
854 @end deftypefn 912 @end deftypefn
855 913
856 @c pexecute.txh:274 914 @c pexecute.txh:286
857 @deftypefn Extension {const char *} pex_one (int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, int *@var{status}, int *@var{err}) 915 @deftypefn Extension {const char *} pex_one (int @var{flags}, @
916 const char *@var{executable}, char * const *@var{argv}, @
917 const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, @
918 int *@var{status}, int *@var{err})
858 919
859 An interface to permit the easy execution of a 920 An interface to permit the easy execution of a
860 single program. The return value and most of the parameters are as 921 single program. The return value and most of the parameters are as
861 for a call to @code{pex_run}. @var{flags} is restricted to a 922 for a call to @code{pex_run}. @var{flags} is restricted to a
862 combination of @code{PEX_SEARCH}, @code{PEX_STDERR_TO_STDOUT}, and 923 combination of @code{PEX_SEARCH}, @code{PEX_STDERR_TO_STDOUT}, and
864 @code{PEX_LAST} were set. On a successful return, @code{*@var{status}} will 925 @code{PEX_LAST} were set. On a successful return, @code{*@var{status}} will
865 be set to the exit status of the program. 926 be set to the exit status of the program.
866 927
867 @end deftypefn 928 @end deftypefn
868 929
869 @c pexecute.txh:228 930 @c pexecute.txh:237
870 @deftypefn Extension {FILE *} pex_read_err (struct pex_obj *@var{obj}, int @var{binary}) 931 @deftypefn Extension {FILE *} pex_read_err (struct pex_obj *@var{obj}, @
932 int @var{binary})
871 933
872 Returns a @code{FILE} pointer which may be used to read the standard 934 Returns a @code{FILE} pointer which may be used to read the standard
873 error of the last program in the pipeline. When this is used, 935 error of the last program in the pipeline. When this is used,
874 @code{PEX_LAST} should not be used in a call to @code{pex_run}. After 936 @code{PEX_LAST} should not be used in a call to @code{pex_run}. After
875 this is called, @code{pex_run} may no longer be called with the same 937 this is called, @code{pex_run} may no longer be called with the same
877 opened in binary mode. Don't call @code{fclose} on the returned file; 939 opened in binary mode. Don't call @code{fclose} on the returned file;
878 it will be closed by @code{pex_free}. 940 it will be closed by @code{pex_free}.
879 941
880 @end deftypefn 942 @end deftypefn
881 943
882 @c pexecute.txh:216 944 @c pexecute.txh:224
883 @deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, int @var{binary}) 945 @deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, @
946 int @var{binary})
884 947
885 Returns a @code{FILE} pointer which may be used to read the standard 948 Returns a @code{FILE} pointer which may be used to read the standard
886 output of the last program in the pipeline. When this is used, 949 output of the last program in the pipeline. When this is used,
887 @code{PEX_LAST} should not be used in a call to @code{pex_run}. After 950 @code{PEX_LAST} should not be used in a call to @code{pex_run}. After
888 this is called, @code{pex_run} may no longer be called with the same 951 this is called, @code{pex_run} may no longer be called with the same
890 opened in binary mode. Don't call @code{fclose} on the returned file; 953 opened in binary mode. Don't call @code{fclose} on the returned file;
891 it will be closed by @code{pex_free}. 954 it will be closed by @code{pex_free}.
892 955
893 @end deftypefn 956 @end deftypefn
894 957
895 @c pexecute.txh:33 958 @c pexecute.txh:34
896 @deftypefn Extension {const char *} pex_run (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{outname}, const char *@var{errname}, int *@var{err}) 959 @deftypefn Extension {const char *} pex_run (struct pex_obj *@var{obj}, @
960 int @var{flags}, const char *@var{executable}, char * const *@var{argv}, @
961 const char *@var{outname}, const char *@var{errname}, int *@var{err})
897 962
898 Execute one program in a pipeline. On success this returns 963 Execute one program in a pipeline. On success this returns
899 @code{NULL}. On failure it returns an error message, a statically 964 @code{NULL}. On failure it returns an error message, a statically
900 allocated string. 965 allocated string.
901 966
1000 On an error return, the code sets @code{*@var{err}} to an @code{errno} 1065 On an error return, the code sets @code{*@var{err}} to an @code{errno}
1001 value, or to 0 if there is no relevant @code{errno}. 1066 value, or to 0 if there is no relevant @code{errno}.
1002 1067
1003 @end deftypefn 1068 @end deftypefn
1004 1069
1005 @c pexecute.txh:142 1070 @c pexecute.txh:145
1006 @deftypefn Extension {const char *} pex_run_in_environment (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{executable}, char * const *@var{argv}, char * const *@var{env}, int @var{env_size}, const char *@var{outname}, const char *@var{errname}, int *@var{err}) 1071 @deftypefn Extension {const char *} pex_run_in_environment (struct pex_obj *@var{obj}, @
1072 int @var{flags}, const char *@var{executable}, char * const *@var{argv}, @
1073 char * const *@var{env}, int @var{env_size}, const char *@var{outname}, @
1074 const char *@var{errname}, int *@var{err})
1007 1075
1008 Execute one program in a pipeline, permitting the environment for the 1076 Execute one program in a pipeline, permitting the environment for the
1009 program to be specified. Behaviour and parameters not listed below are 1077 program to be specified. Behaviour and parameters not listed below are
1010 as for @code{pex_run}. 1078 as for @code{pex_run}.
1011 1079
1014 form @code{VAR=VALUE}, with the exception of the last element that must be 1082 form @code{VAR=VALUE}, with the exception of the last element that must be
1015 @code{NULL}. 1083 @code{NULL}.
1016 1084
1017 @end deftypefn 1085 @end deftypefn
1018 1086
1019 @c pexecute.txh:286 1087 @c pexecute.txh:301
1020 @deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int @var{flags}) 1088 @deftypefn Extension int pexecute (const char *@var{program}, @
1089 char * const *@var{argv}, const char *@var{this_pname}, @
1090 const char *@var{temp_base}, char **@var{errmsg_fmt}, @
1091 char **@var{errmsg_arg}, int @var{flags})
1021 1092
1022 This is the old interface to execute one or more programs. It is 1093 This is the old interface to execute one or more programs. It is
1023 still supported for compatibility purposes, but is no longer 1094 still supported for compatibility purposes, but is no longer
1024 documented. 1095 documented.
1025 1096
1042 @samp{name=value} the string is added; if no @samp{=} is present the 1113 @samp{name=value} the string is added; if no @samp{=} is present the
1043 name is unset/removed. 1114 name is unset/removed.
1044 1115
1045 @end deftypefn 1116 @end deftypefn
1046 1117
1047 @c pexecute.txh:294 1118 @c pexecute.txh:312
1048 @deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags}) 1119 @deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags})
1049 1120
1050 Another part of the old execution interface. 1121 Another part of the old execution interface.
1051 1122
1052 @end deftypefn 1123 @end deftypefn
1053 1124
1054 @c random.c:39 1125 @c random.c:39
1055 @deftypefn Supplement {long int} random (void) 1126 @deftypefn Supplement {long int} random (void)
1056 @deftypefnx Supplement void srandom (unsigned int @var{seed}) 1127 @deftypefnx Supplement void srandom (unsigned int @var{seed})
1057 @deftypefnx Supplement void* initstate (unsigned int @var{seed}, void *@var{arg_state}, unsigned long @var{n}) 1128 @deftypefnx Supplement void* initstate (unsigned int @var{seed}, @
1129 void *@var{arg_state}, unsigned long @var{n})
1058 @deftypefnx Supplement void* setstate (void *@var{arg_state}) 1130 @deftypefnx Supplement void* setstate (void *@var{arg_state})
1059 1131
1060 Random number functions. @code{random} returns a random number in the 1132 Random number functions. @code{random} returns a random number in the
1061 range 0 to @code{LONG_MAX}. @code{srandom} initializes the random 1133 range 0 to @code{LONG_MAX}. @code{srandom} initializes the random
1062 number generator to some starting point determined by @var{seed} 1134 number generator to some starting point determined by @var{seed}
1064 run of the program). @code{initstate} and @code{setstate} allow fine-grained 1136 run of the program). @code{initstate} and @code{setstate} allow fine-grained
1065 control over the state of the random number generator. 1137 control over the state of the random number generator.
1066 1138
1067 @end deftypefn 1139 @end deftypefn
1068 1140
1069 @c concat.c:173 1141 @c concat.c:174
1070 @deftypefn Extension char* reconcat (char *@var{optr}, const char *@var{s1}, @dots{}, @code{NULL}) 1142 @deftypefn Extension char* reconcat (char *@var{optr}, const char *@var{s1}, @
1143 @dots{}, @code{NULL})
1071 1144
1072 Same as @code{concat}, except that if @var{optr} is not @code{NULL} it 1145 Same as @code{concat}, except that if @var{optr} is not @code{NULL} it
1073 is freed after the string is created. This is intended to be useful 1146 is freed after the string is created. This is intended to be useful
1074 when you're extending an existing string or building up a string in a 1147 when you're extending an existing string or building up a string in a
1075 loop: 1148 loop:
1095 the string @var{s}, or @code{NULL} if not found. The use of @code{rindex} is 1168 the string @var{s}, or @code{NULL} if not found. The use of @code{rindex} is
1096 deprecated in new programs in favor of @code{strrchr}. 1169 deprecated in new programs in favor of @code{strrchr}.
1097 1170
1098 @end deftypefn 1171 @end deftypefn
1099 1172
1100 @c setenv.c:22 1173 @c setenv.c:23
1101 @deftypefn Supplemental int setenv (const char *@var{name}, const char *@var{value}, int @var{overwrite}) 1174 @deftypefn Supplemental int setenv (const char *@var{name}, @
1175 const char *@var{value}, int @var{overwrite})
1102 @deftypefnx Supplemental void unsetenv (const char *@var{name}) 1176 @deftypefnx Supplemental void unsetenv (const char *@var{name})
1103 1177
1104 @code{setenv} adds @var{name} to the environment with value 1178 @code{setenv} adds @var{name} to the environment with value
1105 @var{value}. If the name was already present in the environment, 1179 @var{value}. If the name was already present in the environment,
1106 the new value will be stored only if @var{overwrite} is nonzero. 1180 the new value will be stored only if @var{overwrite} is nonzero.
1107 The companion @code{unsetenv} function removes @var{name} from the 1181 The companion @code{unsetenv} function removes @var{name} from the
1108 environment. This implementation is not safe for multithreaded code. 1182 environment. This implementation is not safe for multithreaded code.
1183
1184 @end deftypefn
1185
1186 @c setproctitle.c:31
1187 @deftypefn Supplemental void setproctitle (const char *@var{fmt}, ...)
1188
1189 Set the title of a process to @var{fmt}. va args not supported for now,
1190 but defined for compatibility with BSD.
1109 1191
1110 @end deftypefn 1192 @end deftypefn
1111 1193
1112 @c strsignal.c:348 1194 @c strsignal.c:348
1113 @deftypefn Extension int signo_max (void) 1195 @deftypefn Extension int signo_max (void)
1134 the old mask (which, for libiberty's implementation, will always 1216 the old mask (which, for libiberty's implementation, will always
1135 be the value @code{1}). 1217 be the value @code{1}).
1136 1218
1137 @end deftypefn 1219 @end deftypefn
1138 1220
1221 @c simple-object.txh:96
1222 @deftypefn Extension {const char *} simple_object_attributes_compare @
1223 (simple_object_attributes *@var{attrs1}, simple_object_attributes *@var{attrs2}, @
1224 int *@var{err})
1225
1226 Compare @var{attrs1} and @var{attrs2}. If they could be linked
1227 together without error, return @code{NULL}. Otherwise, return an
1228 error message and set @code{*@var{err}} to an errno value or @code{0}
1229 if there is no relevant errno.
1230
1231 @end deftypefn
1232
1233 @c simple-object.txh:81
1234 @deftypefn Extension {simple_object_attributes *} simple_object_fetch_attributes @
1235 (simple_object_read *@var{simple_object}, const char **@var{errmsg}, int *@var{err})
1236
1237 Fetch the attributes of @var{simple_object}. The attributes are
1238 internal information such as the format of the object file, or the
1239 architecture it was compiled for. This information will persist until
1240 @code{simple_object_attributes_release} is called, even if
1241 @var{simple_object} itself is released.
1242
1243 On error this returns @code{NULL}, sets @code{*@var{errmsg}} to an
1244 error message, and sets @code{*@var{err}} to an errno value or
1245 @code{0} if there is no relevant errno.
1246
1247 @end deftypefn
1248
1249 @c simple-object.txh:49
1250 @deftypefn Extension {int} simple_object_find_section @
1251 (simple_object_read *@var{simple_object} off_t *@var{offset}, @
1252 off_t *@var{length}, const char **@var{errmsg}, int *@var{err})
1253
1254 Look for the section @var{name} in @var{simple_object}. This returns
1255 information for the first section with that name.
1256
1257 If found, return 1 and set @code{*@var{offset}} to the offset in the
1258 file of the section contents and set @code{*@var{length}} to the
1259 length of the section contents. The value in @code{*@var{offset}}
1260 will be relative to the offset passed to
1261 @code{simple_object_open_read}.
1262
1263 If the section is not found, and no error occurs,
1264 @code{simple_object_find_section} returns @code{0} and set
1265 @code{*@var{errmsg}} to @code{NULL}.
1266
1267 If an error occurs, @code{simple_object_find_section} returns
1268 @code{0}, sets @code{*@var{errmsg}} to an error message, and sets
1269 @code{*@var{err}} to an errno value or @code{0} if there is no
1270 relevant errno.
1271
1272 @end deftypefn
1273
1274 @c simple-object.txh:27
1275 @deftypefn Extension {const char *} simple_object_find_sections @
1276 (simple_object_read *@var{simple_object}, int (*@var{pfn}) (void *@var{data}, @
1277 const char *@var{name}, off_t @var{offset}, off_t @var{length}), @
1278 void *@var{data}, int *@var{err})
1279
1280 This function calls @var{pfn} for each section in @var{simple_object}.
1281 It calls @var{pfn} with the section name, the offset within the file
1282 of the section contents, and the length of the section contents. The
1283 offset within the file is relative to the offset passed to
1284 @code{simple_object_open_read}. The @var{data} argument to this
1285 function is passed along to @var{pfn}.
1286
1287 If @var{pfn} returns @code{0}, the loop over the sections stops and
1288 @code{simple_object_find_sections} returns. If @var{pfn} returns some
1289 other value, the loop continues.
1290
1291 On success @code{simple_object_find_sections} returns. On error it
1292 returns an error string, and sets @code{*@var{err}} to an errno value
1293 or @code{0} if there is no relevant errno.
1294
1295 @end deftypefn
1296
1297 @c simple-object.txh:2
1298 @deftypefn Extension {simple_object_read *} simple_object_open_read @
1299 (int @var{descriptor}, off_t @var{offset}, const char *{segment_name}, @
1300 const char **@var{errmsg}, int *@var{err})
1301
1302 Opens an object file for reading. Creates and returns an
1303 @code{simple_object_read} pointer which may be passed to other
1304 functions to extract data from the object file.
1305
1306 @var{descriptor} holds a file descriptor which permits reading.
1307
1308 @var{offset} is the offset into the file; this will be @code{0} in the
1309 normal case, but may be a different value when reading an object file
1310 in an archive file.
1311
1312 @var{segment_name} is only used with the Mach-O file format used on
1313 Darwin aka Mac OS X. It is required on that platform, and means to
1314 only look at sections within the segment with that name. The
1315 parameter is ignored on other systems.
1316
1317 If an error occurs, this functions returns @code{NULL} and sets
1318 @code{*@var{errmsg}} to an error string and sets @code{*@var{err}} to
1319 an errno value or @code{0} if there is no relevant errno.
1320
1321 @end deftypefn
1322
1323 @c simple-object.txh:107
1324 @deftypefn Extension {void} simple_object_release_attributes @
1325 (simple_object_attributes *@var{attrs})
1326
1327 Release all resources associated with @var{attrs}.
1328
1329 @end deftypefn
1330
1331 @c simple-object.txh:73
1332 @deftypefn Extension {void} simple_object_release_read @
1333 (simple_object_read *@var{simple_object})
1334
1335 Release all resources associated with @var{simple_object}. This does
1336 not close the file descriptor.
1337
1338 @end deftypefn
1339
1340 @c simple-object.txh:184
1341 @deftypefn Extension {void} simple_object_release_write @
1342 (simple_object_write *@var{simple_object})
1343
1344 Release all resources associated with @var{simple_object}.
1345
1346 @end deftypefn
1347
1348 @c simple-object.txh:114
1349 @deftypefn Extension {simple_object_write *} simple_object_start_write @
1350 (simple_object_attributes @var{attrs}, const char *@var{segment_name}, @
1351 const char **@var{errmsg}, int *@var{err})
1352
1353 Start creating a new object file using the object file format
1354 described in @var{attrs}. You must fetch attribute information from
1355 an existing object file before you can create a new one. There is
1356 currently no support for creating an object file de novo.
1357
1358 @var{segment_name} is only used with Mach-O as found on Darwin aka Mac
1359 OS X. The parameter is required on that target. It means that all
1360 sections are created within the named segment. It is ignored for
1361 other object file formats.
1362
1363 On error @code{simple_object_start_write} returns @code{NULL}, sets
1364 @code{*@var{ERRMSG}} to an error message, and sets @code{*@var{err}}
1365 to an errno value or @code{0} if there is no relevant errno.
1366
1367 @end deftypefn
1368
1369 @c simple-object.txh:153
1370 @deftypefn Extension {const char *} simple_object_write_add_data @
1371 (simple_object_write *@var{simple_object}, @
1372 simple_object_write_section *@var{section}, const void *@var{buffer}, @
1373 size_t @var{size}, int @var{copy}, int *@var{err})
1374
1375 Add data @var{buffer}/@var{size} to @var{section} in
1376 @var{simple_object}. If @var{copy} is non-zero, the data will be
1377 copied into memory if necessary. If @var{copy} is zero, @var{buffer}
1378 must persist until @code{simple_object_write_to_file} is called. is
1379 released.
1380
1381 On success this returns @code{NULL}. On error this returns an error
1382 message, and sets @code{*@var{err}} to an errno value or 0 if there is
1383 no relevant erro.
1384
1385 @end deftypefn
1386
1387 @c simple-object.txh:134
1388 @deftypefn Extension {simple_object_write_section *} simple_object_write_create_section @
1389 (simple_object_write *@var{simple_object}, const char *@var{name}, @
1390 unsigned int @var{align}, const char **@var{errmsg}, int *@var{err})
1391
1392 Add a section to @var{simple_object}. @var{name} is the name of the
1393 new section. @var{align} is the required alignment expressed as the
1394 number of required low-order 0 bits (e.g., 2 for alignment to a 32-bit
1395 boundary).
1396
1397 The section is created as containing data, readable, not writable, not
1398 executable, not loaded at runtime. The section is not written to the
1399 file until @code{simple_object_write_to_file} is called.
1400
1401 On error this returns @code{NULL}, sets @code{*@var{errmsg}} to an
1402 error message, and sets @code{*@var{err}} to an errno value or
1403 @code{0} if there is no relevant errno.
1404
1405 @end deftypefn
1406
1407 @c simple-object.txh:170
1408 @deftypefn Extension {const char *} simple_object_write_to_file @
1409 (simple_object_write *@var{simple_object}, int @var{descriptor}, int *@var{err})
1410
1411 Write the complete object file to @var{descriptor}, an open file
1412 descriptor. This writes out all the data accumulated by calls to
1413 @code{simple_object_write_create_section} and
1414 @var{simple_object_write_add_data}.
1415
1416 This returns @code{NULL} on success. On error this returns an error
1417 message and sets @code{*@var{err}} to an errno value or @code{0} if
1418 there is no relevant errno.
1419
1420 @end deftypefn
1421
1139 @c snprintf.c:28 1422 @c snprintf.c:28
1140 @deftypefn Supplemental int snprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, ...) 1423 @deftypefn Supplemental int snprintf (char *@var{buf}, size_t @var{n}, @
1424 const char *@var{format}, ...)
1141 1425
1142 This function is similar to @code{sprintf}, but it will write to 1426 This function is similar to @code{sprintf}, but it will write to
1143 @var{buf} at most @code{@var{n}-1} bytes of text, followed by a 1427 @var{buf} at most @code{@var{n}-1} bytes of text, followed by a
1144 terminating null byte, for a total of @var{n} bytes. 1428 terminating null byte, for a total of @var{n} bytes.
1145 On error the return value is -1, otherwise it returns the number of 1429 On error the return value is -1, otherwise it returns the number of
1158 number of spaces and null terminated. The returned pointer is 1442 number of spaces and null terminated. The returned pointer is
1159 valid until at least the next call. 1443 valid until at least the next call.
1160 1444
1161 @end deftypefn 1445 @end deftypefn
1162 1446
1447 @c splay-tree.c:303
1448 @deftypefn Supplemental splay_tree splay_tree_new_with_typed_alloc @
1449 (splay_tree_compare_fn @var{compare_fn}, @
1450 splay_tree_delete_key_fn @var{delete_key_fn}, @
1451 splay_tree_delete_value_fn @var{delete_value_fn}, @
1452 splay_tree_allocate_fn @var{tree_allocate_fn}, @
1453 splay_tree_allocate_fn @var{node_allocate_fn}, @
1454 splay_tree_deallocate_fn @var{deallocate_fn}, @
1455 void * @var{allocate_data})
1456
1457 This function creates a splay tree that uses two different allocators
1458 @var{tree_allocate_fn} and @var{node_allocate_fn} to use for allocating the
1459 tree itself and its nodes respectively. This is useful when variables of
1460 different types need to be allocated with different allocators.
1461
1462 The splay tree will use @var{compare_fn} to compare nodes,
1463 @var{delete_key_fn} to deallocate keys, and @var{delete_value_fn} to
1464 deallocate values.
1465
1466 @end deftypefn
1467
1163 @c stpcpy.c:23 1468 @c stpcpy.c:23
1164 @deftypefn Supplemental char* stpcpy (char *@var{dst}, const char *@var{src}) 1469 @deftypefn Supplemental char* stpcpy (char *@var{dst}, const char *@var{src})
1165 1470
1166 Copies the string @var{src} into @var{dst}. Returns a pointer to 1471 Copies the string @var{src} into @var{dst}. Returns a pointer to
1167 @var{dst} + strlen(@var{src}). 1472 @var{dst} + strlen(@var{src}).
1168 1473
1169 @end deftypefn 1474 @end deftypefn
1170 1475
1171 @c stpncpy.c:23 1476 @c stpncpy.c:23
1172 @deftypefn Supplemental char* stpncpy (char *@var{dst}, const char *@var{src}, size_t @var{len}) 1477 @deftypefn Supplemental char* stpncpy (char *@var{dst}, const char *@var{src}, @
1478 size_t @var{len})
1173 1479
1174 Copies the string @var{src} into @var{dst}, copying exactly @var{len} 1480 Copies the string @var{src} into @var{dst}, copying exactly @var{len}
1175 and padding with zeros if necessary. If @var{len} < strlen(@var{src}) 1481 and padding with zeros if necessary. If @var{len} < strlen(@var{src})
1176 then return @var{dst} + @var{len}, otherwise returns @var{dst} + 1482 then return @var{dst} + @var{len}, otherwise returns @var{dst} +
1177 strlen(@var{src}). 1483 strlen(@var{src}).
1249 A case-insensitive @code{strncmp}. 1555 A case-insensitive @code{strncmp}.
1250 1556
1251 @end deftypefn 1557 @end deftypefn
1252 1558
1253 @c strncmp.c:6 1559 @c strncmp.c:6
1254 @deftypefn Supplemental int strncmp (const char *@var{s1}, const char *@var{s2}, size_t @var{n}) 1560 @deftypefn Supplemental int strncmp (const char *@var{s1}, @
1561 const char *@var{s2}, size_t @var{n})
1255 1562
1256 Compares the first @var{n} bytes of two strings, returning a value as 1563 Compares the first @var{n} bytes of two strings, returning a value as
1257 @code{strcmp}. 1564 @code{strcmp}.
1258 1565
1259 @end deftypefn 1566 @end deftypefn
1326 length, the function returns @var{string}. 1633 length, the function returns @var{string}.
1327 1634
1328 @end deftypefn 1635 @end deftypefn
1329 1636
1330 @c strtod.c:27 1637 @c strtod.c:27
1331 @deftypefn Supplemental double strtod (const char *@var{string}, char **@var{endptr}) 1638 @deftypefn Supplemental double strtod (const char *@var{string}, @
1639 char **@var{endptr})
1332 1640
1333 This ISO C function converts the initial portion of @var{string} to a 1641 This ISO C function converts the initial portion of @var{string} to a
1334 @code{double}. If @var{endptr} is not @code{NULL}, a pointer to the 1642 @code{double}. If @var{endptr} is not @code{NULL}, a pointer to the
1335 character after the last character used in the conversion is stored in 1643 character after the last character used in the conversion is stored in
1336 the location referenced by @var{endptr}. If no conversion is 1644 the location referenced by @var{endptr}. If no conversion is
1346 to an errno value. If no translation is found, returns 0. 1654 to an errno value. If no translation is found, returns 0.
1347 1655
1348 @end deftypefn 1656 @end deftypefn
1349 1657
1350 @c strtol.c:33 1658 @c strtol.c:33
1351 @deftypefn Supplemental {long int} strtol (const char *@var{string}, char **@var{endptr}, int @var{base}) 1659 @deftypefn Supplemental {long int} strtol (const char *@var{string}, @
1352 @deftypefnx Supplemental {unsigned long int} strtoul (const char *@var{string}, char **@var{endptr}, int @var{base}) 1660 char **@var{endptr}, int @var{base})
1661 @deftypefnx Supplemental {unsigned long int} strtoul (const char *@var{string}, @
1662 char **@var{endptr}, int @var{base})
1353 1663
1354 The @code{strtol} function converts the string in @var{string} to a 1664 The @code{strtol} function converts the string in @var{string} to a
1355 long integer value according to the given @var{base}, which must be 1665 long integer value according to the given @var{base}, which must be
1356 between 2 and 36 inclusive, or be the special value 0. If @var{base} 1666 between 2 and 36 inclusive, or be the special value 0. If @var{base}
1357 is 0, @code{strtol} will look for the prefixes @code{0} and @code{0x} 1667 is 0, @code{strtol} will look for the prefixes @code{0} and @code{0x}
1456 pointer unchanged. If the @var{stream} is @code{NULL} do nothing. 1766 pointer unchanged. If the @var{stream} is @code{NULL} do nothing.
1457 1767
1458 @end deftypefn 1768 @end deftypefn
1459 1769
1460 @c vasprintf.c:47 1770 @c vasprintf.c:47
1461 @deftypefn Extension int vasprintf (char **@var{resptr}, const char *@var{format}, va_list @var{args}) 1771 @deftypefn Extension int vasprintf (char **@var{resptr}, @
1772 const char *@var{format}, va_list @var{args})
1462 1773
1463 Like @code{vsprintf}, but instead of passing a pointer to a buffer, 1774 Like @code{vsprintf}, but instead of passing a pointer to a buffer,
1464 you pass a pointer to a pointer. This function will compute the size 1775 you pass a pointer to a pointer. This function will compute the size
1465 of the buffer needed, allocate memory with @code{malloc}, and store a 1776 of the buffer needed, allocate memory with @code{malloc}, and store a
1466 pointer to the allocated memory in @code{*@var{resptr}}. The value 1777 pointer to the allocated memory in @code{*@var{resptr}}. The value
1477 1788
1478 @end deftypefn 1789 @end deftypefn
1479 1790
1480 @c vprintf.c:3 1791 @c vprintf.c:3
1481 @deftypefn Supplemental int vprintf (const char *@var{format}, va_list @var{ap}) 1792 @deftypefn Supplemental int vprintf (const char *@var{format}, va_list @var{ap})
1482 @deftypefnx Supplemental int vfprintf (FILE *@var{stream}, const char *@var{format}, va_list @var{ap}) 1793 @deftypefnx Supplemental int vfprintf (FILE *@var{stream}, @
1483 @deftypefnx Supplemental int vsprintf (char *@var{str}, const char *@var{format}, va_list @var{ap}) 1794 const char *@var{format}, va_list @var{ap})
1795 @deftypefnx Supplemental int vsprintf (char *@var{str}, @
1796 const char *@var{format}, va_list @var{ap})
1484 1797
1485 These functions are the same as @code{printf}, @code{fprintf}, and 1798 These functions are the same as @code{printf}, @code{fprintf}, and
1486 @code{sprintf}, respectively, except that they are called with a 1799 @code{sprintf}, respectively, except that they are called with a
1487 @code{va_list} instead of a variable number of arguments. Note that 1800 @code{va_list} instead of a variable number of arguments. Note that
1488 they do not call @code{va_end}; this is the application's 1801 they do not call @code{va_end}; this is the application's
1490 nonstandard but common function @code{_doprnt}. 1803 nonstandard but common function @code{_doprnt}.
1491 1804
1492 @end deftypefn 1805 @end deftypefn
1493 1806
1494 @c vsnprintf.c:28 1807 @c vsnprintf.c:28
1495 @deftypefn Supplemental int vsnprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, va_list @var{ap}) 1808 @deftypefn Supplemental int vsnprintf (char *@var{buf}, size_t @var{n}, @
1809 const char *@var{format}, va_list @var{ap})
1496 1810
1497 This function is similar to @code{vsprintf}, but it will write to 1811 This function is similar to @code{vsprintf}, but it will write to
1498 @var{buf} at most @code{@var{n}-1} bytes of text, followed by a 1812 @var{buf} at most @code{@var{n}-1} bytes of text, followed by a
1499 terminating null byte, for a total of @var{n} bytes. On error the 1813 terminating null byte, for a total of @var{n} bytes. On error the
1500 return value is -1, otherwise it returns the number of characters that 1814 return value is -1, otherwise it returns the number of characters that
1579 @code{xmalloc_failed} when printing a failure message. 1893 @code{xmalloc_failed} when printing a failure message.
1580 1894
1581 @end deftypefn 1895 @end deftypefn
1582 1896
1583 @c xmemdup.c:7 1897 @c xmemdup.c:7
1584 @deftypefn Replacement void* xmemdup (void *@var{input}, size_t @var{copy_size}, size_t @var{alloc_size}) 1898 @deftypefn Replacement void* xmemdup (void *@var{input}, @
1899 size_t @var{copy_size}, size_t @var{alloc_size})
1585 1900
1586 Duplicates a region of memory without fail. First, @var{alloc_size} bytes 1901 Duplicates a region of memory without fail. First, @var{alloc_size} bytes
1587 are allocated, then @var{copy_size} bytes from @var{input} are copied into 1902 are allocated, then @var{copy_size} bytes from @var{input} are copied into
1588 it, and the new memory is returned. If fewer bytes are copied than were 1903 it, and the new memory is returned. If fewer bytes are copied than were
1589 allocated, the remaining memory is zeroed. 1904 allocated, the remaining memory is zeroed.