diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2003-11-24 17:18:23 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2003-11-24 17:18:23 +0000 |
commit | 1a34b77c2e3c1e0e16b60017498ca735863bfe65 (patch) | |
tree | 29df39876a47634e4c3c610694fe687b3914238a /gnu | |
parent | 24c4973ef25d4c5d3ddb9e5acd4bb6ebeca24827 (diff) |
bye, bye, they moved.
(all these changes were okay'ed millert@, btw)
Diffstat (limited to 'gnu')
123 files changed, 0 insertions, 36373 deletions
diff --git a/gnu/egcs/include/COPYING b/gnu/egcs/include/COPYING deleted file mode 100644 index 60549be514a..00000000000 --- a/gnu/egcs/include/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) 19yy <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/gnu/egcs/include/ChangeLog b/gnu/egcs/include/ChangeLog deleted file mode 100644 index 120fb2adb87..00000000000 --- a/gnu/egcs/include/ChangeLog +++ /dev/null @@ -1,1460 +0,0 @@ -1999-04-02 Mark Mitchell <mark@codesourcery.com> - - * splay-tree.h (splay_tree_compare_pointers): Declare. - -1999-03-30 Mark Mitchell <mark@codesourcery.com> - - * splay-tree.h (splay_tree_compare_ints): Declare. - -Wed Mar 24 12:46:29 1999 Andrew Cagney <cagney@amy.cygnus.com> - - * libiberty.h (basename): Cygwin{,32} should have the prototype. - -Mon Dec 14 09:53:31 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * demangle.h: Don't check IN_GCC anymore. - * splay-tree.h: Likewise. - -Tue Dec 8 00:30:31 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * demangle.h: (DMGL_EDG): new macro for Kuck and Associates - (DMGL_STYLE_MASK): modify to include Kuck and Assoc style - (demangling_styles): add new edg_demangling style - (EDG_DEMANGLING_STYLE_STRING): new macro - (EDG_DEMANGLING): new macro - - * demangle.h (DMGL_HP): new macro, for HP/aCC compiler. - (DMGL_STYLE_MASK): modify to include new HP's style. - (demangling_styles): add new hp_demangling value. - (HP_DEMANGLING_STYLE_STRING): new macro. - (ARM_DEMANGLING): coerce to int. - (HP_DEMANGLING): new macro. - -Fri Nov 20 13:14:00 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * libiberty.h (basename): Add prototype for FreeBSD. - -Fri Nov 13 19:19:11 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * libiberty.h: Prototype xcalloc. - -Sun Nov 8 17:42:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * ansidecl.h: Wrap problematic macros with !IN_GCC. - - * demangle.h: Never define PARAMS(). - * splay-tree.h: Likewise. - -Sat Nov 7 16:04:03 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * demangle.h: Don't include gansidecl.h. - * splay-tree.h: Likewise. - -Thu Oct 22 19:58:00 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * splay-tree.h: Wrap function pointer parameter declarations in - PARAMS() macro. - -1998-10-21 Mark Mitchell <mark@markmitchell.com> - - * splay-tree.h: New file. - -Fri Oct 9 00:02:03 1998 Jeffrey A Law (law@cygnus.com) - - * Merge devo and egcs include directories. - -Sat Sep 5 12:16:33 1998 Jeffrey A Law (law@cygnus.com) - - * getopt.h, obstack.h: Updated from gcc. - -1998-08-03 Jason Molenda (jsm@bugshack.cygnus.com) - - * libiberty.h (xexit): Change decl to use modern GCC attribute - to indicate exit does not return. - -Mon Jun 1 13:48:32 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * obstack.h: Update to latest FSF version. - -Tue Feb 24 13:05:02 1998 Doug Evans <devans@canuck.cygnus.com> - - * dis-asm.h (disassemble_info): Member `symbol' renamed to `symbols' - and made an "asymbol **". New member num_symbols. - (INIT_DISASSEMBLE_INFO_NO_ARCH): Update. - -Tue Feb 17 12:32:18 1998 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h (sim_fetch_register, sim_store_register): Add - register length parameter. Functions return actual length of - register. - -Thu Feb 12 16:29:01 1998 Ian Lance Taylor <ian@cygnus.com> - - * getopt.h: Update to latest FSF version. - -Wed Feb 11 16:56:06 1998 Doug Evans <devans@canuck.cygnus.com> - - * symcat.h: New file. - -Mon Feb 2 17:13:31 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU> - - * dis-asm.h (print_insn_tic30): Declare. - -Thu Jan 22 16:23:59 1998 Fred Fish <fnf@cygnus.com> - - * dis-asm.h: Add flag INSN_HAS_RELOC to tell disassembly - function there is a reloc on this line. - -Mon Dec 8 11:22:23 1997 Nick Clifton <nickc@cygnus.com> - - * dis-asm.h: Remove prototype of disasm_symaddr() as this function - no longer exists. - -Tue Dec 2 10:20:53 1997 Nick Clifton <nickc@cygnus.com> - - * dis-asm.h (disasm_symaddr): New prototype. - -Mon Dec 1 20:24:18 1997 J"orn Rennecke <amylaar@cygnus.co.uk> - - * coff/sh.h (R_SH_SWITCH8): New. - -Mon Dec 1 11:29:35 1997 Doug Evans <devans@canuck.cygnus.com> - - * callback.h (CB_SYSCALL): Comment out arg names in prototypes. - -Wed Nov 26 16:47:58 1997 Michael Meissner <meissner@cygnus.com> - - * callback.h (CB_SYSCALL): Consistantly use names for prototype - arguments. - -Wed Nov 26 11:39:30 1997 Doug Evans <devans@canuck.cygnus.com> - - * callback.h (CB_SYSCALL): Change byte count arguments to - {read,write}_mem to `int'. New member `magic'. - (CB_SYSCALL_MAGIC,CB_SYSCALL_INIT): New macros. - -Tue Nov 25 01:35:52 1997 Doug Evans <devans@seba.cygnus.com> - - * callback.h (struct stat): Move forward decl up. - (host_callback): Pass stat struct pointer to stat,fstat. - (CB_SYS_nnn): Reorganize. - (CB_SYSCALL): New members p1,p2. - (cb_host_to_target_stat): Delete fourth arg. - -Sat Nov 22 23:34:15 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h (sim_stop_reason): Clarify sim_signalled SIGRC - argument. - -Mon Nov 17 14:00:51 1997 Doug Evans <devans@seba.cygnus.com> - - * callback.h (CB_TARGET_DEFS_MAP): Renamed from target_defs_map. - (host_callback): Add stat, fstat, syscall_map, errno_map, open_map, - signal_map, stat_map. - (errn_map,open_map): Renamed to cb_init_foo_map. - (cb_host_to_target_errno,cb_target_to_host_open): Renamed from - host_to_target_errno,target_to_host_open. - (cb_read_target_syscall_maps): Add prototype. - (cb_target_to_host_syscall): Likewise. - (cb_host_to_target_stat): Likewise. - (cb_syscall): Likewise. - (CB_SYS_{exit,open,close,read,write,lseek,unlink,getpid,kill,fstat, - argvlen,argv,chdir,stat,chmod,utime,time}): Define. - (CB_SYSCALL): New type. - (CB_RC): New enum. - -Fri Nov 7 10:34:09 1997 Rob Savoye <rob@darkstar.cygnus.com> - - * libiberty.h: Add extern "C" { so it can be used with C++ - programs. - * remote-sim.h: Add extern "C" { so it can be used with C++ - programs. - -Tue Oct 14 16:07:51 1997 Nick Clifton <nickc@cygnus.com> - - * dis-asm.h (struct disassemble_info): New field - 'symbol_at_address_func'. - (INIT_DISASSEMBLE_INFO_NO_ARCH): Initialise new field with - generic_symbol_at_address. - -Mon Oct 13 10:17:15 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h: Clarify sim_read, sim_write MEM argument. - -Wed Sep 24 18:03:10 1997 Stu Grossman <grossman@babylon-5.cygnus.com> - - * remote-sim.h (SIM_RC): Add a bunch of new return codes for - breakpoint stuff. - * Add functions to tell the simulator to set/clear/enable/disable - intrinsic breakpoints. - -Thu Aug 28 19:41:42 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * libiberty.h (dupargv): Add prototype. - -Tue Aug 26 12:25:49 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h (sim_create_inferior): Add ABFD arg. Document. - -Mon Aug 25 10:50:51 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h (sim_open): Add ABFD arg. Document. - -Fri Aug 8 16:43:56 1997 Doug Evans <dje@canuck.cygnus.com> - - * dis-asm.h (arc_get_disassembler): Declare. - -Wed Jul 30 11:39:50 1997 Per Bothner <bothner@deneb.cygnus.com> - - * demangle.h (DMGL_JAVA): New option to request Java demangling. - -Tue Jul 22 17:59:54 1997 Ian Lance Taylor <ian@cygnus.com> - - * libiberty.h (PEXECUTE_*): Define. - (pexecute, pwait): Declare. - -Fri Jun 6 13:02:33 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h (sim_kill): Mark as depreciated. - -Fri May 23 13:43:41 1997 Fred Fish <fnf@cygnus.com> - - * bfdlink.h (struct bfd_link_info): Add task_link member. - -Thu May 22 11:32:49 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h: Review documentation. Clarify restrictions on - when functions can be called. - -Wed May 21 16:47:53 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h (sim_set_profile_size): Add prototype, document as - depreciated. - -Tue May 20 09:32:22 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h (sim_open): Add callback struct. - (sim_set_callbacks): Drop SIM_DESC argument. Document. - (sim_size): Remove recently added SIM_DESC argument. Document. - -Mon May 19 19:14:44 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h: Pass SD into sim_size. - -Thu May 15 01:24:16 1997 Mark Alexander <marka@cygnus.com> - - * obstack.h (obstack_specify_allocation_with_arg, obstack_chunkfun, - obstack_freefun): Eliminate compile warnings in gdb. - -Tue May 13 10:21:14 1997 Nick Clifton <nickc@cygnus.com> - - * coff/arm.h (constants): Added new flag bits F_APCS_26 and - F_APCS_SET for the f_flags field of the filehdr structure. Added new - flags: F_APCS26, F_ARM_2, F_ARM_3, F_ARM_7, F_ARM_7T to store - information in the flags field of the internal_f structure used by BFD - routines. - -Tue Apr 22 10:24:34 1997 Fred Fish <fnf@cygnus.com> - - * floatformat.h (floatformat_byteorders): Add comments for previous - formats and add floatformat_littlebyte_bigword, primarily for ARM. - Add declaration for floatformat_ieee_double_littlebyte_bigword. - -Fri Apr 18 13:04:49 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * remote-sim.h (sim_stop): New interface - asynchronous - notification of a request to stop / suspend the running - simulation. - - * remote-sim.h (enum sim_stop): Add sim_running and sim_polling as - states for use internal to simulators. - - * callback.h (struct host_callback_strut): Put a magic number at - the end of the struct to allow basic checking. - (struct host_callback_struct ): Add poll_quit - so - that the console etc can be polled at regular intervals. - -Thu Apr 17 02:17:12 1997 Doug Evans <dje@canuck.cygnus.com> - - * remote-sim.h (struct _bfd): Declare. - (sim_load): Return SIM_RC. New arg `abfd'. - (sim_create_inferior): Return SIM_RC. Delete arg `start_address'. - -Wed Apr 2 17:09:12 1997 Andrew Cagney <cagney@kremvax.cygnus.com> - - * remote-sim.h (sim_trace, sim_size): Make these global. They - will go away shortly. - -Wed Apr 2 15:23:49 1997 Doug Evans <dje@canuck.cygnus.com> - - * remote-sim.h (SIM_OPEN_KIND, SIM_RC): New enums. - (sim_open): New argument `kind'. - -Wed Apr 2 14:45:51 1997 Ian Lance Taylor <ian@cygnus.com> - - * COPYING: Update FSF address. - -Fri Mar 28 15:29:54 1997 Mike Meissner <meissner@cygnus.com> - - * callback.h (top level): Include stdarg.h or varargs.h if - va_start is not defined. - (host_callback_struct): Make {,e}vprintf_filtered take a va_list - instead of void *, since va_list might be an array or structure - type. - -Fri Mar 28 15:44:41 1997 H.J. Lu <hjl@gnu.ai.mit.edu> - - * libiberty.h (basename): Add prototype for glibc and linux. - -Mon Mar 17 19:22:12 1997 Ian Lance Taylor <ian@cygnus.com> - - * objalloc.h: New file. - -Mon Mar 17 14:57:55 1997 Andrew Cagney <cagney@kremvax.cygnus.com> - - * remote-sim.h: New file, copied in from gdb/remote-sim.h. One - day this will be placed in a directory of its own. - -Sat Mar 15 19:00:14 1997 Ian Lance Taylor <ian@cygnus.com> - - * obstack.h: Update to current FSF version. - -Thu Mar 6 15:46:59 1997 Andrew Cagney <cagney@kremvax.cygnus.com> - - * callback.h (struct host_callback_struct): Add callbacks - - flush_stdout, write_stderr, flush_stderr, vprintf_filtered, - evprintf_filtered. Delete redundant callbacks - printf_filtered. - -Thu Feb 27 23:18:27 1997 Ian Lance Taylor <ian@cygnus.com> - - * bfdlink.h (struct bfd_link_info): Remove lprefix and lprefix_len - fields. - -Tue Feb 25 00:10:49 1997 Ian Lance Taylor <ian@cygnus.com> - - * dis-asm.h (INIT_DISASSEMBLE_INFO_NO_ARCH): Initialize - bytes_per_chunk and display_endian. - -Mon Feb 24 17:47:02 1997 Ian Lance Taylor <ian@cygnus.com> - - From Eric Youngdale <eric@andante.jic.com>: - * bfdlink.h (struct bfd_elf_version_expr): Define. - (struct bfd_elf_version_deps): Define. - (struct bfd_elf_version_tree): Define. - -Thu Feb 6 14:20:01 1997 Martin M. Hunt <hunt@pizza.cygnus.com> - - * dis-asm.h: (disassemble_info): Add new fields - bytes_per_chunk and display_endian to control the - display of raw instructions. - -Sun Dec 8 17:11:12 1996 Doug Evans <dje@canuck.cygnus.com> - - * callback.h (host_callback): New member `error'. - -Wed Nov 20 00:40:23 1996 Doug Evans <dje@canuck.cygnus.com> - - * callback.h: New file, moved here from gdb. - -Mon Nov 18 16:34:00 1996 Dawn Perchik <dawn@critters.cygnus.com> - - * libiberty.h: Checkin again; last checkin failed due to sticky tag. - -Wed Nov 13 08:22:00 1996 Dawn Perchik <dawn@critters.cygnus.com> - - * libiberty.h: Revert last commit due to conflicts with hpux - system headers. - -Tue Nov 12 16:31:00 1996 Dawn Perchik <dawn@critters.cygnus.com> - - * libiberty.h: Move prototypes from argv.c here. - -Thu Oct 31 14:56:18 1996 Doug Evans <dje@canuck.cygnus.com> - - * ansidecl.h (VPARAMS,VA_START): Define. - -Fri Oct 25 12:08:04 1996 Ian Lance Taylor <ian@cygnus.com> - - * dis-asm.h (disassemble_info): Add bytes_per_line field. - (INIT_DISASSEMBLE_INFO_NO_ARCH): Initialize bytes_per_line field. - -Thu Oct 24 17:10:01 1996 Ian Lance Taylor <ian@cygnus.com> - - * dis-asm.h (disassemble_info): Add symbol field. - (INIT_DISASSEMBLE_INFO_NO_ARCH): Initialize symbol field. - -Thu Oct 17 11:17:40 1996 Doug Evans <dje@canuck.cygnus.com> - - * dis-asm.h (print_insn_m32r): Declare. - -Mon Oct 14 23:56:52 1996 Ian Lance Taylor <ian@cygnus.com> - - * libiberty.h: Declare parameter types for xmalloc and xrealloc. - -Thu Oct 3 13:45:27 1996 Ian Lance Taylor <ian@cygnus.com> - - * fnmatch.h: New file. - -Thu Oct 3 10:33:14 1996 Jeffrey A Law (law@cygnus.com) - - * dis-asm.h (print_insn_mn10x00): Delete declaration. - (print_insn_mn10200, print_insn_mn10300): Declare. - -Wed Oct 2 21:24:43 1996 Jeffrey A Law (law@cygnus.com) - - * dis-asm.h (print_insn_mn10x00): Declare. - -Mon Sep 30 13:56:11 1996 Fred Fish <fnf@cygnus.com> - - * libiberty.h: Remove #ifndef PRIVATE_XMALLOC. - -Sat Aug 31 13:27:06 1996 Jeffrey A Law (law@cygnus.com) - - * dis-asm.h (print_insn_v850): Declare. - -Tue Aug 13 16:10:30 1996 Stu Grossman (grossman@critters.cygnus.com) - - * obstack.h: Change bcopy to memcpy. Works better on Posix - systems, which generally lack bcopy. - -Mon Aug 12 17:03:18 1996 Stu Grossman (grossman@critters.cygnus.com) - - * ansidecl.h: Change WIN32 to _WIN32. - -Fri Jul 26 13:58:18 1996 Ian Lance Taylor <ian@cygnus.com> - - * dis-asm.h: Add flavour field. - (print_insn_alpha): Declare. - (print_insn_alpha_osf, print_insn_alpha_vms): Don't declare. - (INIT_DISASSEMBLE_INFO): Initialize flavour field. - -Tue Jul 23 17:37:58 1996 Fred Fish <fnf@cygnus.com> - - * libiberty.h (PRIVATE_XMALLOC): Enclose xmalloc/xrealloc - definitions inside #ifndef so that programs that want to - can define PRIVATE_XMALLOC and then define xmalloc and - xrealloc anyway they want. - (basename): Document in source that we can't declare the - parameter type because it is declared inconsistently across - different systems. - -Mon Jul 22 13:16:13 1996 Richard Henderson <rth@tamu.edu> - - * dis-asm.h (print_insn_alpha): Don't declare. - (print_insn_alpha_osf, print_insn_alpha_vms): Declare. - -Wed Jul 17 14:45:12 1996 Martin M. Hunt <hunt@pizza.cygnus.com> - - * dis-asm.h: (print_insn_d10v): Declare. - -Mon Jul 15 16:55:38 1996 Stu Grossman (grossman@critters.cygnus.com) - - * dis-asm.h: Get rid of decls for print_insn_i8086, - print_insn_sparc64 and print_insn_sparclite. - * (INIT_DISASSEMBLE_INFO): Split into two pieces. One, - INIT_DISASSEMBLE_INFO_NO_ARCH inits everything except for endian, - mach, and arch. - -Fri Jul 12 10:19:27 1996 Stu Grossman (grossman@critters.cygnus.com) - - * dis-asm.h (print_insn_i8086): Declare. - -Wed Jul 3 16:02:39 1996 Stu Grossman (grossman@critters.cygnus.com) - - * dis-asm.h (print_insn_sparclite): Declare. - -Tue Jun 18 16:02:46 1996 Jeffrey A. Law <law@rtl.cygnus.com> - - * dis-asm.h (print_insn_h8300s): Declare. - -Tue Jun 18 15:11:33 1996 Klaus Kaempf <kkaempf@progis.de> - - * fopen-vms.h: New file. - -Tue Jun 4 18:58:16 1996 Ian Lance Taylor <ian@cygnus.com> - - * bfdlink.h (struct bfd_link_info): Add notice_all field. - -Fri Apr 26 10:33:12 1996 Doug Evans <dje@canuck.cygnus.com> - - * demangle.h (#ifdef IN_GCC): #include "gansidecl.h". - (PROTO,PTR,const): Delete. - -Mon Apr 22 17:27:42 1996 Ian Lance Taylor <ian@cygnus.com> - - * bfdlink.h (struct bfd_link_info): Add traditional_format field. - -Mon Apr 15 15:16:56 1996 Doug Evans <dje@canuck.cygnus.com> - - * libiberty.h (choose_temp_base): Add prototype. - -Tue Mar 12 17:29:46 1996 Ian Lance Taylor <ian@cygnus.com> - - * bfdlink.h (bfd_wrapped_link_hash_lookup): Declare. - (struct bfd_link_info): Add wrap_hash field. - -Wed Feb 14 16:49:17 1996 Martin Anantharaman <martin@mail.imech.uni-duisburg.de> - - * ieee.h (ieee_record_enum_type): Define - ieee_external_reference_info_enum. - -Fri Feb 2 17:09:25 1996 Doug Evans <dje@charmed.cygnus.com> - - * dis-asm.h (DISASM_RAW_INSN): Delete. - -Tue Jan 23 09:21:47 1996 Doug Evans <dje@charmed.cygnus.com> - - * dis-asm.h (INIT_DISASSEMBLE_INFO): Set endian to BFD_ENDIAN_UNKNOWN. - New argument FPRINTF_FUNC. - -Mon Jan 22 16:37:59 1996 Doug Evans <dje@charmed.cygnus.com> - - * dis-asm.h (disassemble_info): New members arch, mach, endian. - (INIT_DISASSEMBLE_INFO): Initialize them. - (DISASM_RAW_INSN{,FLAG}): Define. - -Thu Jan 18 11:32:38 1996 Ian Lance Taylor <ian@cygnus.com> - - * demangle.h (cplus_demangle_opname): Change opname parameter to - const char *. - (cplus_mangle_opname): Change return type and opname parameter to - const char *. - -Fri Jan 5 00:01:22 1996 Ian Lance Taylor <ian@cygnus.com> - - * ieee.h (enum ieee_record): Add ieee_asn_record_enum, - ieee_at_record_enum, ieee_ty_record_enum, ieee_atn_record_enum, - ieee_bb_record_enum, and ieee_be_record_enum. - -Wed Jan 3 13:12:09 1996 Fred Fish <fnf@cygnus.com> - - * obstack.h: Update copyright to 1996. - (_obstack_memory_used): Declare. - (obstack_memory_used): Define macro. - -Thu Dec 28 11:42:12 1995 Ian Lance Taylor <ian@cygnus.com> - - * libiberty.h (xstrdup): Declare. - -Thu Dec 21 14:47:17 1995 Michael Meissner <meissner@tiktok.cygnus.com> - - * wait.h: Protect all macros with #ifndef. - -Tue Oct 24 21:45:40 1995 Ian Lance Taylor <ian@cygnus.com> - - * bfdlink.h (struct bfd_link_info): Add static_link field. - -Tue Sep 12 16:28:04 1995 Ian Lance Taylor <ian@cygnus.com> - - * bfdlink.h (struct bfd_link_callbacks): Add symbol parameter to - warning callback. - -Fri Sep 1 13:11:51 1995 Ian Lance Taylor <ian@cygnus.com> - - * bfdlink.h (struct bfd_link_callbacks): Change warning callback - to take BFD, section, and address arguments. - -Thu Aug 31 16:45:12 1995 steve chamberlain <sac@slash.cygnus.com> - - * bfdlink.h (struct bfd_link_info): Remove PE stuff. - -Tue Aug 22 03:18:23 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com> - - * libiberty.h: Declare xstrerror. From Pat Rankin. - -Mon Aug 21 18:11:36 1995 steve chamberlain <sac@slash.cygnus.com> - - * bfdlink.h (struct bfd_link_info): Remove PE stuff. - -Wed Aug 2 08:14:12 1995 Doug Evans <dje@canuck.cygnus.com> - - * dis-asm.h (print_insn_sparc64): Declare. - -Mon Jul 10 13:26:49 1995 Eric Youngdale <eric@aib.com> - - * bfdlink.h (struct bfd_link_info): Add new field symbolic. - -Sun Jul 2 17:48:40 1995 Ian Lance Taylor <ian@cygnus.com> - - * bfdlink.h (struct bfd_link_info): Change type of base_file to - PTR. - -Thu Jun 29 00:02:45 1995 Steve Chamberlain <sac@slash.cygnus.com> - - * bfdlink.h (struct bfd_link_info): Added base_file member. - -Tue Jun 20 16:40:04 1995 Steve Chamberlain <sac@slash.cygnus.com> - - * ansidecl.h: win32s is ANSI enough. - -Thu May 18 04:25:50 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com> - - Wed May 10 14:28:16 1995 Richard Earnshaw (rearnsha@armltd.co.uk) - - * dis-asm.h (print_insn_arm): Delete declaration. - (print_insn_{little,big}_arm): New declarations. - - * floatformat.h (floatformat_arm_ext): Declare. - -Sat May 13 10:14:08 1995 Steve Chamberlain <sac@slash.cygnus.com> - - * coff/pe.h: New file. - * bfdlink.h (subsytem, stack_heap_parameters): New. - * coff/i386.h (NT_SECTION_ALIGNMENT, NT_FILE_ALIGNMENT, - NT_DEF_RESERVE, NT_DEF_COMMIT): New. - * coff/internal.h (internal_filehdr): New fields for PE. - (IMAGE_DATA_DIRECTORY): New. - (internal_aouthdr): New fields for PE. - -Thu May 4 14:36:42 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * demangle.h: Don't include ansidecl.h if IN_GCC. - -Tue Feb 21 00:37:28 1995 Jeff Law (law@snake.cs.utah.edu) - - * hp-symtab.h: Don't use bitfield enumerations, the HP C compiler - does not handle them correctly. - -Thu Feb 9 14:20:27 1995 Ian Lance Taylor <ian@cygnus.com> - - * libiberty.h (basename): Don't declare parameter type; some - systems have this in their header files. - -Wed Feb 8 17:35:38 1995 Ian Lance Taylor <ian@cygnus.com> - - * bfdlink.h (struct bfd_link_hash_entry): Change format of common - symbol information, to remove restrictions on maximum size and - alignment power, by using a pointer to a structure instead. - -Mon Feb 6 14:55:32 1995 Ian Lance Taylor <ian@cygnus.com> - - * bfdlink.h (enum bfd_link_hash_type): Rename bfd_link_hash_weak - to bfd_link_hash_undefweak. Add bfd_link_hash_defweak. - -Mon Jan 16 21:00:23 1995 Stan Shebs <shebs@andros.cygnus.com> - - * dis-asm.h (GDB_INIT_DISASSEMBLE_INFO, etc): Remove all - GDB-specific definitions. - -Sun Jan 15 18:39:35 1995 Steve Chamberlain <sac@splat> - - * dis-asm.h (print_insn_w65): Declare. - -Thu Jan 12 17:51:17 1995 Ken Raeburn <raeburn@cujo.cygnus.com> - - * libiberty.h (hex_p): Fix sense of test. - -Wed Jan 11 22:36:40 1995 Ken Raeburn <raeburn@cujo.cygnus.com> - - * libiberty.h (_hex_array_size, _hex_bad, _hex_value, hex_init, - hex_p, hex_value): New macros and declarations, for hex.c. - -Fri Jan 6 17:44:14 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> - - * dis-asm.h: Make idempotent. - -Wed Dec 14 13:08:43 1994 Stan Shebs <shebs@andros.cygnus.com> - - * progress.h: New file, empty definitions for progress macros. - -Fri Nov 25 00:14:05 1994 Jeff Law (law@snake.cs.utah.edu) - - * hp-symtab.h: New file describing the debug symbols emitted - by the HP C compilers. - -Fri Nov 11 15:48:37 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> - - * bfdlink.h (struct bfd_link_hash_entry): Change u.c.size from 24 - to 26 bits, and change u.c.alignment_power from 8 to 6 bits. 6 - bit in the alignment power is enough for a 64 bit address space. - -Mon Oct 31 13:02:51 1994 Stan Shebs (shebs@andros.cygnus.com) - - * demangle.h (cplus_mangle_opname): Declare. - -Tue Oct 25 11:38:02 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> - - * bfdlink.h (struct bfd_link_callbacks): Fix comments for - multiple_common field. - -Sun Sep 04 17:58:10 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org) - - * aout/aout64.h: Only define QMAGIC if it isn't already defined. - - * dis-asm.h: Add support for the ARM. - -Wed Aug 10 12:51:41 1994 Doug Evans (dje@canuck.cygnus.com) - - * libiberty.h (strsignal): Document its existence even if we - can't declare it. - -Tue Aug 2 14:40:03 1994 Jim Kingdon (kingdon@lioth.cygnus.com) - - * os9k.h: Remove u_int16, u_int32, and owner_id typedefs and - expand their uses. Those names conflict with Mach headers. - -Fri Jul 22 14:17:12 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * bfdlink.h (struct bfd_link_hash_entry): Change u.c.size into a - bitfield. Add field u.c.alignment_power. - -Sun Jul 10 00:26:39 1994 Ian Dall (dall@hfrd.dsto.gov.au) - - * dis-asm.h: Add print_insn_ns32k declaration. - -Mon Jun 20 17:13:29 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * bfdlink.h (bfd_link_hash_table): Make creator a const pointer. - -Sat Jun 18 16:09:32 1994 Stan Shebs (shebs@andros.cygnus.com) - - * demangle.h (cplus_demangle_opname): Declare. - -Thu Jun 16 15:19:03 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfdlink.h (struct bfd_link_info): Add new field shared. - -Mon Jun 6 14:39:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfdlink.h (struct bfd_link_hash_entry): Remove written field: - not needed for all backends. - -Thu Apr 28 19:06:50 1994 Ken Raeburn (raeburn@cujo.cygnus.com) - - * dis-asm.h (disassembler): Declare. - -Fri Apr 1 00:38:17 1994 Jim Wilson (wilson@mole.gnu.ai.mit.edu) - - * obstack.h: Delete use of IN_GCC to control whether - stddef.h or gstddef.h is included. - -Tue Mar 22 13:06:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfdlink.h (enum bfd_link_order_type): Add bfd_data_link_order. - (struct bfd_link_order): Add data field to union. - -Mon Mar 21 18:45:26 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfdlink.h (struct bfd_link_callbacks): Change bitsize argument - to add_to_set to reloc. Remove bitsize argument from constructor. - Comment that reloc_overflow, reloc_dangerous and unattached_reloc - must handle NULL pointers for reloc location. - (enum bfd_link_order_type): Add bfd_section_reloc_link_order and - bfd_symbol_reloc_link_order. - (struct bfd_link_order): Add reloc field to union. - (struct bfd_link_order_reloc): Define. - -Mon Mar 14 12:27:50 1994 Ian Lance Taylor (ian@cygnus.com) - - * ieee-float.h: Removed; no longer used. - -Tue Mar 1 18:10:49 1994 Kung Hsu (kung@mexican.cygnus.com) - - * os9k.h: os9000 target specific header file, the header of the - object file is used now. - -Sun Feb 27 21:52:26 1994 Jim Kingdon (kingdon@deneb.cygnus.com) - - * floatformat.h: New file, intended to replace ieee-float.h. - -Sun Feb 20 17:15:42 1994 Ian Lance Taylor (ian@lisa.cygnus.com) - - * ansidecl.h (ANSI_PROTOTYPES): Define if using ANSI prototypes. - -Wed Feb 16 01:07:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * libiberty.h: Don't declare strsignal, to avoid conflicts with - Solaris system header files. - -Sat Feb 12 22:11:32 1994 Jeffrey A. Law (law@snake.cs.utah.edu) - - * libiberty.h (xexit): Use __volatile__ to avoid losing if - compiling with gcc -traditional. - -Thu Feb 10 14:05:41 1994 Ian Lance Taylor (ian@cygnus.com) - - * libiberty.h: New file. Declares functions provided by - libiberty. - -Tue Feb 8 05:19:52 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - Handle obstack_chunk_alloc returning NULL. This allows - obstacks to be used by libraries, without forcing them - to call exit or longjmp. - * obstack.h (struct obstack): Add alloc_failed flag. - _obstack_begin, _obstack_begin_1): Declare to return int, not void. - (obstack_finish): If alloc_failed, return NULL. - (obstack_base, obstack_next_free, objstack_object_size): - If alloc_failed, return 0. - (obstack_grow, obstack_grow0, obstack_1grow, obstack_ptr_grow, - obstack_int_grow, obstack_blank): If alloc_failed, do nothing that - could corrupt the obstack. - -Mon Jan 24 15:06:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfdlink.h (struct bfd_link_callbacks): Add name, reloc_name and - addend argments to reloc_overflow callback. - -Fri Jan 21 19:13:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * dis-asm.h (print_insn_big_powerpc, print_insn_little_powerpc, - print_insn_rs6000): Declare. - -Thu Jan 6 14:15:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfdlink.h (struct bfd_link_callbacks): Add bitsize argument to - add_to_set field. Add new callback named constructor. - -Thu Dec 30 10:44:06 1993 Ian Lance Taylor (ian@rtl.cygnus.com) - - * bfdlink.h: New file for new BFD linker backend routines. - -Mon Nov 29 10:43:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * dis-asm.h (enum dis_insn_tyupe): Remove non-ANSI trailing comma. - -Sat Oct 2 20:42:26 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * dis-asm.h: Move comment to right place. - -Mon Aug 9 19:03:35 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * obstack.h (obstack_chunkfun, obstack_freefun): Add defns from - previous version. Are these Cygnus local changes? - -Fri Aug 6 17:05:47 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * getopt.h, obstack.h: Update to latest FSF version. - -Mon Aug 2 16:37:14 1993 Stu Grossman (grossman at cygnus.com) - - * coff/i386.h: Add Lynx magic number. - -Mon Aug 2 14:45:29 1993 John Gilmore (gnu@cygnus.com) - - * dis-asm.h: Move enum outside of struct defn to avoid warnings. - -Mon Aug 2 08:49:30 1993 Stu Grossman (grossman at cygnus.com) - - * wait.h (WEXITSTATUS, WSTOPSIG): Mask down to 8 bits. This is - for systems that store stuff into the high 16 bits of a wait - status. - -Fri Jul 30 18:38:02 1993 John Gilmore (gnu@cygnus.com) - - * dis-asm.h: Add new fields insn_info_valid, branch_delay_insns, - data_size, insn_type, target, target2. These are used to return - information from the instruction decoders back to the calling - program. Add comments, make more readable. - -Mon Jul 19 22:14:14 1993 Fred Fish (fnf@deneb.cygnus.com) - - * nlm: New directory containing NLM/NetWare includes. - -Thu Jul 15 12:10:04 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * dis-asm.h (struct disassemble_info): New field application_data. - -Thu Jul 15 12:41:15 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * dis-asm.h: Added declaration of print_insn_m88k. - -Thu Jul 8 09:05:26 1993 Doug Evans (dje@canuck.cygnus.com) - - * opcode/h8300.h: Lots of little fixes for the h8/300h. - -Fri Jul 2 10:31:59 1993 Ian Lance Taylor (ian@cygnus.com) - - * ansidecl.h: Use ANSI macros if __mips and _SYSTYPE_SVR4 are - defined, since RISC/OS cc handles ANSI declarations in SVR4 mode - but does not define __STDC__. - -Sun Jun 20 18:27:52 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) - - * dis-asm.h: Don't need to include ansidecl.h any more. - -Fri Jun 18 03:22:10 1993 John Gilmore (gnu@cygnus.com) - - * oasys.h: Eliminate "int8_type", "int16_type", "int32_type", and - their variants. These changes are coordinated with corresponding - changes in ../bfd/oasys.c. - -Wed Jun 16 10:43:08 1993 Fred Fish (fnf@cygnus.com) - - * bfd.h: Note that it has been removed. - -Tue Jun 8 12:16:03 1993 Steve Chamberlain (sac@phydeaux.cygnus.com) - - Support for H8/300-H - * dis-asm.h (print_insn_h8300, print_insn_h8300h): Declare it. - * coff/h8300.h: New magic number. - * coff/internal.h: New relocations. - * opcode/h8300.h: Lots of new opcodes. - -Tue Jun 1 07:35:03 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) - - * ansidecl.h (const): Don't define it if it's already defined. - -Thu May 27 18:19:51 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * dis-asm.h (print_insn_hppa): Declare it. - - * bfd.h: Moved to bfd directory. Small stub here includes it - without requiring "-I../bfd". - -Thu Apr 29 12:06:13 1993 Ken Raeburn (raeburn@deneb.cygnus.com) - - * bfd.h: Updated with BSF_FUNCTION. - -Mon Apr 26 18:15:50 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * bfd.h, dis-asm.h: Updated with Hitachi SH. - -Fri Apr 23 18:41:38 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * bfd.h: Updated with alpha changes. - * dis-asm.h: Added alpha. - -Fri Apr 16 17:35:30 1993 Jim Kingdon (kingdon@cygnus.com) - - * bfd.h: Update for signed bfd_*get_*. - -Thu Apr 15 09:24:21 1993 Jim Kingdon (kingdon@cygnus.com) - - * bfd.h: Updated for file_truncated error. - -Thu Apr 8 10:53:47 1993 Ian Lance Taylor (ian@cygnus.com) - - * ansidecl.h: If no ANSI, define const to be empty. - -Thu Apr 1 09:00:10 1993 Jim Kingdon (kingdon@cygnus.com) - - * dis-asm.h: Declare a29k and i960 print_insn_*. - - * dis-asm.h: Add print_address_func and related stuff. - - * dis-asm.h (dis_asm_read_memory): Fix prototype. - -Wed Mar 31 17:40:16 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * dis-asm.h: Add print_insn_sparc. - -Wed Mar 31 17:51:42 1993 Ian Lance Taylor (ian@cygnus.com) - - * bfd.h: Updated for BFD_RELOC_MIPS_GPREL and bfd_[gs]et_gp_size - prototypes. - -Wed Mar 31 16:35:12 1993 Stu Grossman (grossman@cygnus.com) - - * dis-asm.h: (disassemble_info): Fix typo in prototype of - dis_asm_memory_error(). - -Tue Mar 30 19:09:23 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * dis-asm.h (disassembler_info): Add read_memory_func, - memory_error_func, buffer, and length. - ({GDB_,}INIT_DISASSEMBLE_INFO): Set them. - print_insn_*: Remove second argument. - -Tue Mar 30 14:48:55 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * bfd.h: Update for lma field of section. - -Tue Mar 30 12:22:55 1993 Jim Kingdon (kingdon@cygnus.com) - - * ansidecl.h: Use ANSI versions on AIX regardless of __STDC__. - -Fri Mar 19 14:49:49 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * dis-asm.h: Add h8500. - -Thu Mar 18 13:49:09 1993 Per Bothner (bothner@rtl.cygnus.com) - - * ieee-float.h: Moved from ../gdb. - * dis-asm.h: New file. Interface to dis-assembler. - -Thu Mar 11 10:52:57 1993 Fred Fish (fnf@cygnus.com) - - * demangle.h (DMGL_NO_OPTS): Add define (set to 0) to use - in place of bare 0, for readability reasons. - -Tue Mar 2 17:50:11 1993 Fred Fish (fnf@cygnus.com) - - * demangle.h: Replace all references to cfront with ARM. - -Tue Feb 23 12:21:14 1993 Ian Lance Taylor (ian@cygnus.com) - - * bfd.h: Update for new elements in JUMP_TABLE. - -Tue Feb 16 00:51:30 1993 John Gilmore (gnu@cygnus.com) - - * bfd.h: Update for BFD_VERSION 2.1. - -Tue Jan 26 11:49:20 1993 Ian Lance Taylor (ian@cygnus.com) - - * bfd.h: Update for SEC_IS_COMMON flag. - -Tue Jan 19 12:25:12 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfd.h: Update for bfd_asymbol_value bug fix. - -Fri Jan 8 16:37:18 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfd.h: Update to include ECOFF tdata and target_flavour. - -Sun Dec 27 17:52:30 1992 Fred Fish (fnf@cygnus.com) - - * bfd.h: Add declaration for bfd_get_size(). - -Tue Dec 22 22:42:46 1992 Fred Fish (fnf@cygnus.com) - - * demangle.h: Protect file from multiple inclusions with - #if !defined(DEMANGLE_H)...#define DEMANGLE_H...#endif. - -Mon Dec 21 21:25:50 1992 Stu Grossman (grossman at cygnus.com) - - * bfd.h: Update to get hppa_core_struct from bfd.c. - -Thu Dec 17 00:42:35 1992 John Gilmore (gnu@cygnus.com) - - * bfd.h: Update to get tekhex tdata name change from bfd. - -Mon Nov 9 23:55:42 1992 John Gilmore (gnu@cygnus.com) - - * ansidecl.h: Update comments to discourage use of EXFUN. - -Thu Nov 5 16:35:44 1992 Ian Lance Taylor (ian@cygnus.com) - - * bfd.h: Update to bring in SEC_SHARED_LIBRARY. - -Thu Nov 5 03:21:32 1992 John Gilmore (gnu@cygnus.com) - - * bfd.h: Update to match EXFUN, bfd_seclet_struct, and SDEF - cleanups in bfd. - -Wed Nov 4 07:28:05 1992 Ken Raeburn (raeburn@cygnus.com) - - * bout.h (N_CALLNAME, N_BALNAME): Define as char-type values, so - widening works consistently. - -Fri Oct 16 03:17:08 1992 John Gilmore (gnu@cygnus.com) - - * getopt.h: Update to Revised Standard FSF Version. - -Thu Oct 15 21:43:22 1992 K. Richard Pixley (rich@sendai.cygnus.com) - - * getopt.h (struct option): use the provided enum for has_arg. - - * demangle.h (AUTO_DEMANGLING, GNU_DEMANGLING, - LUCID_DEMANGLING): ultrix compilers require enums to be - enums and ints to be ints and casts where they meet. cast some - enums into ints. - -Thu Oct 15 04:35:51 1992 John Gilmore (gnu@cygnus.com) - - * bfd.h: Update after comment changes. - -Thu Oct 8 09:03:02 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * bfd.h (bfd_get_symbol_leading_char): new macro for getting in xvec - -Thu Sep 3 09:10:50 1992 Stu Grossman (grossman at cygnus.com) - - * bfd.h (struct reloc_howto_struct): size needs to be signed if - it's going to hold negative values. - -Sun Aug 30 17:50:27 1992 Per Bothner (bothner@rtl.cygnus.com) - - * demangle.h: New file, moved from ../gdb. Made independent - of gdb. Allow demangling style option to be passed as a - parameter to cplus_demangle(), but using the - current_demangling_style global as the default. - -Sat Aug 29 10:07:55 1992 Fred Fish (fnf@cygnus.com) - - * obstack.h: Merge comment change from current FSF version. - -Thu Aug 27 12:59:29 1992 Brendan Kehoe (brendan@cygnus.com) - - * bfd.h: add we32k - -Tue Aug 25 15:07:47 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * bfd.h: new after Z8000 stuff - -Mon Aug 17 09:01:23 1992 Ken Raeburn (raeburn@cygnus.com) - - * bfd.h: Regenerated after page/segment size changes. - -Sat Aug 1 13:46:31 1992 Fred Fish (fnf@cygnus.com) - - * obstack.h: Merge changes from current FSF version. - -Mon Jul 20 21:06:23 1992 Fred Fish (fnf@cygnus.com) - - * obstack.h (area_id, flags): Remove, replace with extra_arg, - use_extra_arg, and maybe_empty_object. - * obstack.h (OBSTACK_MAYBE_EMPTY_OBJECT, OBSTACK_MMALLOC_LIKE): - Remove, replaced by maybe_empty_object and use_extra_arg bitfields. - * obstack.h (obstack_full_begin, _obstack_begin): Remove area_id - and flags arguments. - * obstack.h (obstack_alloc_arg): New macro to set extra_arg. - -Thu Jul 16 08:12:44 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * bfd.h: new after adding BFD_IS_RELAXABLE - -Sat Jul 4 03:22:23 1992 John Gilmore (gnu at cygnus.com) - - * bfd.h: Regen after adding BSF_FILE. - -Mon Jun 29 14:18:36 1992 Fred Fish (fnf at sunfish) - - * obstack.h: Convert bcopy() use to memcpy(), which is more - portable, more standard, and can take advantage of gcc's builtin - functions for increased performance. - -Thu Jun 25 04:46:08 1992 John Gilmore (gnu at cygnus.com) - - * ansidecl.h (PARAMS): Incorporate this macro from gdb's defs.h. - It's a cleaner way to forward-declare function prototypes. - -Fri Jun 19 15:46:32 1992 Stu Grossman (grossman at cygnus.com) - - * bfd.h: HPPA merge. - -Tue Jun 16 21:30:56 1992 K. Richard Pixley (rich@cygnus.com) - - * getopt.h: gratuitous white space changes merged from other prep - releases. - -Thu Jun 11 01:10:55 1992 John Gilmore (gnu at cygnus.com) - - * bfd.h: Regen'd from bfd.c after removing elf_core_tdata_struct. - -Mon May 18 17:29:03 1992 K. Richard Pixley (rich@cygnus.com) - - * getopt.h: merged changes from make-3.62.11. - - * getopt.h: merged changes from grep-1.6 (alpha). - -Fri May 8 14:53:32 1992 K. Richard Pixley (rich@cygnus.com) - - * getopt.h: merged changes from bison-1.18. - -Sat Mar 14 17:25:20 1992 Fred Fish (fnf@cygnus.com) - - * obstack.h: Add "area_id" and "flags" members to obstack - structure. Add obstack_chunkfun() and obstack_freefun() to - set functions explicitly. Convert maybe_empty_object to - a bit in "flags". - -Thu Feb 27 22:01:02 1992 Per Bothner (bothner@cygnus.com) - - * wait.h (WIFSTOPPED): Add IBM rs6000-specific version. - -Fri Feb 21 20:49:20 1992 John Gilmore (gnu at cygnus.com) - - * obstack.h: Add obstack_full_begin. - * bfd.h, obstack.h: Protolint. - -Thu Jan 30 01:18:42 1992 John Gilmore (gnu at cygnus.com) - - * bfd.h: Remove comma from enum declaration. - -Mon Jan 27 22:01:13 1992 Steve Chamberlain (sac at cygnus.com) - - * bfd.h : new target entr, bfd_relax_section - -Wed Dec 18 17:19:44 1991 Stu Grossman (grossman at cygnus.com) - - * bfd.h, ieee.h, opcode/m68k.h, opcode/sparc.h: ANSIfy enums. - -Thu Dec 12 20:59:56 1991 John Gilmore (gnu at cygnus.com) - - * fopen-same.h, fopen-bin.h: New files for configuring - whether fopen distinguishes binary files or not. For use - by host-dependent config files. - -Sat Nov 30 20:46:43 1991 Steve Chamberlain (sac at rtl.cygnus.com) - - * bfd.h: change the documentation format. - - * created coff, elf and opcode and aout directories. Moved: - - aout64.h ==> aout/aout64.h - ar.h ==> aout/ar.h - a.out.encap.h ==> aout/encap.h - a.out.host.h ==> aout/host.h - a.out.hp.h ==> aout/hp.h - a.out.sun4.h ==> aout/sun4.h - ranlib.h ==> aout/ranlib.h - reloc.h ==> aout/reloc.h - stab.def ==> aout/stab.def - stab.gnu.h ==> aout/stab_gnu.h - - coff-a29k.h ==> coff/a29k.h - coff-h8300.h ==> coff/h8300.h - coff-i386.h ==> coff/i386.h - coff-i960.h ==> coff/i960.h - internalcoff.h ==> coff/internal.h - coff-m68k.h ==> coff/m68k.h - coff-m88k.h ==> coff/m88k.h - coff-mips.h ==> coff/mips.h - coff-rs6000.h ==> coff/rs6000.h - - elf-common.h ==> elf/common.h - dwarf.h ==> elf/dwarf.h - elf-external.h ==> elf/external.h - elf-internal.h ==> elf/internal.h - - a29k-opcode.h ==> opcode/a29k.h - arm-opcode.h ==> opcode/arm.h - h8300-opcode.h ==> opcode/h8300.h - i386-opcode.h ==> opcode/i386.h - i860-opcode.h ==> opcode/i860.h - i960-opcode.h ==> opcode/i960.h - m68k-opcode.h ==> opcode/m68k.h - m88k-opcode.h ==> opcode/m88k.h - mips-opcode.h ==> opcode/mips.h - np1-opcode.h ==> opcode/np1.h - ns32k-opcode.h ==> opcode/ns32k.h - pn-opcode.h ==> opcode/pn.h - pyr-opcode.h ==> opcode/pyr.h - sparc-opcode.h ==> opcode/sparc.h - tahoe-opcode.h ==> opcode/tahoe.h - vax-opcode.h ==> opcode/vax.h - - - -Wed Nov 27 10:38:31 1991 Steve Chamberlain (sac at rtl.cygnus.com) - - * internalcoff.h: (internal_scnhdr) took out #def dependency, now - s_nreloc and s_nlnno are always long. (internal_reloc): allways - has an offset field now. - -Fri Nov 22 08:12:58 1991 John Gilmore (gnu at cygnus.com) - - * coff-rs6000.h: Lint; use unsigned chars for external fields. - * internalcoff.h: Lint; cast storage classes to signed char. - -Thu Nov 21 21:01:05 1991 Per Bothner (bothner at cygnus.com) - - * stab.def: Remove the GNU extended type codes (e.g. N_SETT). - * aout64.h: The heuristic for distinguishing between - sunos-style and bsd-style ZMAGIC files (wrt. where the - text segment starts) is moved into (the default definition of) - the macro N_HEADER_IN_TEXT. This definition is only used - if no other definition is used - e.g. bfd/newsos3.c defines - N_HEADER_IN_TEXT(x) to be always 0 (as before). - -Thu Nov 21 11:53:03 1991 John Gilmore (gnu at cygnus.com) - - * aout64.h (N_TXTADDR, N_TXTOFF, N_TXTSIZE): New definitions - that should handle all uses. LOGICAL_ versions deleted. - Eliminate N_HEADER_IN_TEXT, using a_entry to determine which - kind of zmagic a.out file we are looking at. - * coff-rs6000.h: Typo. - -Tue Nov 19 18:43:37 1991 Per Bothner (bothner at cygnus.com) - - (Note: This is a revised entry, as was aout64.h.) - * aout64.h: Some cleanups of N_TXTADDR and N_TXTOFF: - Will now work for both old- and new-style ZMAGIC files, - depending on N_HEADER_IN_TEXT macro. - Add LOGICAL_TXTADDR, LOICAL_TXTOFF and LOGICAL_TXTSIZE - that don't count the exec header as part - of the text segment, to be consistent with bfd. - * a.out.sun4.h: Simplified/fixed for previous change. - -Mon Nov 18 00:02:06 1991 Fred Fish (fnf at cygnus.com) - - * dwarf.h: Update to DWARF draft 5 version from gcc2. - -Thu Nov 14 19:44:59 1991 Per Bothner (bothner at cygnus.com) - - * stab.def: Added defs for extended GNU symbol types, - such as N_SETT. These are normally ifdef'd out (because - of conflicts with a.out.gnu.h), but are used by bfb_stab_name(). - -Thu Nov 14 19:17:03 1991 Fred Fish (fnf at cygnus.com) - - * elf-common.h: Add defines to support ELF symbol table code. - -Mon Nov 11 19:01:06 1991 Fred Fish (fnf at cygnus.com) - - * elf-internal.h, elf-external.h, elf-common.h: Add support for - note sections, which are used in ELF core files to hold copies - of various /proc structures. - -Thu Nov 7 08:58:26 1991 Steve Chamberlain (sac at cygnus.com) - - * internalcoff.h: took out the M88 dependency in the lineno - struct. - * coff-m88k.h: defines GET_LINENO_LNNO and PUT_LINENO_LNNO to use - 32bit linno entries. - * a29k-opcode.h: fixed encoding of mtacc - -Sun Nov 3 11:54:22 1991 Per Bothner (bothner at cygnus.com) - - * bfd.h: Updated from ../bfd/bfd-in.h (q.v). - -Fri Nov 1 11:13:53 1991 John Gilmore (gnu at cygnus.com) - - * internalcoff.h: Add x_csect defines. - -Fri Oct 25 03:18:20 1991 John Gilmore (gnu at cygnus.com) - - * Rename COFF-related files in `coff-ARCH.h' form. - coff-a29k.h, coff-i386.h, coff-i960.h, coff-m68k.h, coff-m88k.h, - coff-mips.h, coff-rs6000.h to be exact. - -Thu Oct 24 22:11:11 1991 John Gilmore (gnu at cygnus.com) - - RS/6000 support, by Metin G. Ozisik, Mimi Phûông-Thåo Võ, and - John Gilmore. - - * a.out.gnu.h: Update slightly. - * bfd.h: Add new error code, fix doc, add bfd_arch_rs6000. - * internalcoff.h: Add more F_ codes for filehdr. Add - rs/6000-dependent fields to aouthdr. Add storage classes - to syments. Add 6000-specific auxent. Add r_size in reloc. - * rs6000coff.c: New file. - -Thu Oct 24 04:13:20 1991 Fred Fish (fnf at cygnus.com) - - * dwarf.h: New file for dwarf support. Copied from gcc2 - distribution. - -Wed Oct 16 13:31:45 1991 John Gilmore (gnu at cygnus.com) - - * aout64.h: Remove PAGE_SIZE defines; they are target-dependent. - Add N_FN_SEQ for N_FN symbol type used on Sequent machines. - * stab.def: Include N_FN_SEQ in table. - * bout.h: External formats of structures use unsigned chars. - -Fri Oct 11 12:40:43 1991 Steve Chamberlain (steve at cygnus.com) - - * bfd.h:upgrade from bfd.c - * internalcoff.h: add n_name, n_zeroes and n_offset macros - * amdcoff.h: Define OMAGIC and AOUTHDRSZ. - -Fri Oct 11 10:58:06 1991 Per Bothner (bothner at cygnus.com) - - * a.out.host.h: Change SEGMENT_SIZE to 0x1000 for Sony. - * bfd.h (align_power): Add (actually move) comment. - -Tue Oct 8 15:29:32 1991 Per Bothner (bothner at cygnus.com) - - * sys/h-rtbsd.h: Define MISSING_VFPRINT (for binutils/bucomm.c). - -Sun Oct 6 19:24:39 1991 John Gilmore (gnu at cygnus.com) - - * aout64.h: Move struct internal_exec to ../bfd/libaout.h so - it can be shared by all `a.out-family' code. Rename - EXTERNAL_LIST_SIZE to EXTERNAL_NLIST_SIZE. Use basic types - for nlist members, and make strx integral rather than pointer. - More commentary on n_type values. - * bout.h: Provide a struct external_exec rather than an - internal_exec. - * m68kcoff.h: Remove `tagentries' which snuck in from the i960 - COFF port. - -Fri Oct 4 01:25:59 1991 John Gilmore (gnu at cygnus.com) - - * h8300-opcode.h: Remove `_enum' from the typedef for an enum. - * bfd.h: Update to match bfd changes. - - * sys/h-i386mach.h, sysdep.h: Add 386 Mach host support. - -Tue Oct 1 04:58:42 1991 John Gilmore (gnu at cygnus.com) - - * bfd.h, elf-common.h, elf-external.h, elf-internal.h: - Add preliminary ELF support, sufficient for GDB, from Fred Fish. - * sysdep.h, sys/h-amix.h: Support Amiga SVR4. - - * sys/h-vaxult.h: Make it work. (David Taylor <taylor@think.com>) - * a.out.vax.h: Remove unused and confusing file. - -Mon Sep 30 12:52:35 1991 Per Bothner (bothner at cygnus.com) - - * sysdep.h: Define NEWSOS3_SYS, and use it. - -Fri Sep 20 13:38:21 1991 John Gilmore (gnu at cygnus.com) - - * a.out.gnu.h (N_FN): Its value *really is* 0x1F. - Fix it, and add comments warning about or-ing N_EXT with it - and/or N_WARNING. - * aout64.h (N_FN): Fix value, add comments about N_EXT. - * stab.def (table at end): Update to show all the type - values <0x20, including low order bits. Move N_FN to - its rightful place. - -Tue Sep 17 17:41:37 1991 Stu Grossman (grossman at cygnus.com) - - * sys/h-irix3.h: sgi/irix support. - -Tue Sep 17 07:52:59 1991 John Gilmore (gnu at cygint.cygnus.com) - - * stab.def (N_DEFD): Add GNU Modula-2 debug stab, from Andrew - Beers. - -Thu Sep 12 14:12:59 1991 John Gilmore (gnu at cygint.cygnus.com) - - * internalcoff.h (SYMNMLEN, FILNMLEN, DIMNUM): Define these - for internalcoff, separately from the various external coff's. - * amdcoff.h, bcs88kcoff.h, i386coff.h, intel-coff.h, m68kcoff.h, - m88k-bcs.h: Prefix SYMNMLEN, FILNMLEN, and DIMNUM with E_'s for - the external struct definitions. - * ecoff.h: Remove these #define's, kludge no longer needed. - - * sys/h-ultra3.h: Add new Ultracomputer host. - * sysdep.h: Add ULTRA3_SYM1_SYS and use it. - -Tue Sep 10 10:11:46 1991 John Gilmore (gnu at cygint.cygnus.com) - - * i386coff.h (LINESZ): Always 6, not based on sizeof(). - (Fix from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.) - -Wed Sep 4 08:58:37 1991 John Gilmore (gnu at cygint.cygnus.com) - - * a.out.gnu.h, aout64.h: Add N_WARNING. Change N_FN to 0x0E, - to match SunOS and BSD. Add N_COMM as 0x12 for SunOS shared lib - support. - * stab.def: Add N_COMM to table, fix overlap comment. - -Tue Sep 3 06:29:20 1991 John Gilmore (gnu at cygint.cygnus.com) - - Merge with latest FSF versions of these files. - - * stab.gnu.h: Add LAST_UNUSED_STAB_CODE. - * stab.def: Update to GPL2. Move N_WARNING out, since not a - debug symbol. Change comments, and reorder table to numeric - order. Update final table comment. - (N_DSLINE, N_BSLINE): Renumber from 0x66 and 0x68, to 0x46 and 0x48. - - * obstack.h: GPL2. Merge. - -Fri Aug 23 01:54:23 1991 John Gilmore (gnu at cygint.cygnus.com) - - * a.out.gnu.h, a.out.sun4.h: Make SEGMENT_SIZE able to depend - on the particular a.out being examined. - * a.out.sun4.h: Define segment sizes for Sun-3's and Sun-4's. - * FIXME: a.out.gnu.h is almost obsolete. - * FIXME: a.out.sun4.h should be renamed a.out.sun.h now. - -Wed Aug 21 20:32:13 1991 John Gilmore (gnu at cygint.cygnus.com) - - * Start a ChangeLog for the includes directory. - - * a.out.gnu.h (N_FN): Fix value -- was 15, should be 0x1E. - * stab.def: Update allocation table in comments at end, - to reflect reality as I know it. - - -Local Variables: -mode: change-log -left-margin: 8 -fill-column: 74 -version-control: never -End: diff --git a/gnu/egcs/include/ansidecl.h b/gnu/egcs/include/ansidecl.h deleted file mode 100644 index cdb9fb71961..00000000000 --- a/gnu/egcs/include/ansidecl.h +++ /dev/null @@ -1,163 +0,0 @@ -/* ANSI and traditional C compatability macros - Copyright 1991, 1992, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* ANSI and traditional C compatibility macros - - ANSI C is assumed if __STDC__ is #defined. - - Macro ANSI C definition Traditional C definition - ----- ---- - ---------- ----------- - ---------- - PTR `void *' `char *' - LONG_DOUBLE `long double' `double' - VOLATILE `volatile' `' - SIGNED `signed' `' - PTRCONST `void *const' `char *' - ANSI_PROTOTYPES 1 not defined - - CONST is also defined, but is obsolete. Just use const. - - obsolete -- DEFUN (name, arglist, args) - - Defines function NAME. - - ARGLIST lists the arguments, separated by commas and enclosed in - parentheses. ARGLIST becomes the argument list in traditional C. - - ARGS list the arguments with their types. It becomes a prototype in - ANSI C, and the type declarations in traditional C. Arguments should - be separated with `AND'. For functions with a variable number of - arguments, the last thing listed should be `DOTS'. - - obsolete -- DEFUN_VOID (name) - - Defines a function NAME, which takes no arguments. - - obsolete -- EXFUN (name, (prototype)) -- obsolete. - - Replaced by PARAMS. Do not use; will disappear someday soon. - Was used in external function declarations. - In ANSI C it is `NAME PROTOTYPE' (so PROTOTYPE should be enclosed in - parentheses). In traditional C it is `NAME()'. - For a function that takes no arguments, PROTOTYPE should be `(void)'. - - obsolete -- PROTO (type, name, (prototype) -- obsolete. - - This one has also been replaced by PARAMS. Do not use. - - PARAMS ((args)) - - We could use the EXFUN macro to handle prototype declarations, but - the name is misleading and the result is ugly. So we just define a - simple macro to handle the parameter lists, as in: - - static int foo PARAMS ((int, char)); - - This produces: `static int foo();' or `static int foo (int, char);' - - EXFUN would have done it like this: - - static int EXFUN (foo, (int, char)); - - but the function is not external...and it's hard to visually parse - the function name out of the mess. EXFUN should be considered - obsolete; new code should be written to use PARAMS. - - DOTS is also obsolete. - - Examples: - - extern int printf PARAMS ((const char *format, ...)); -*/ - -#ifndef _ANSIDECL_H - -#define _ANSIDECL_H 1 - - -/* Every source file includes this file, - so they will all get the switch for lint. */ -/* LINTLIBRARY */ - - -#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) -/* All known AIX compilers implement these things (but don't always - define __STDC__). The RISC/OS MIPS compiler defines these things - in SVR4 mode, but does not define __STDC__. */ - -#define PTR void * -#define PTRCONST void *CONST -#define LONG_DOUBLE long double - -#ifndef IN_GCC -#define AND , -#define NOARGS void -#define VOLATILE volatile -#define SIGNED signed -#endif /* ! IN_GCC */ - -#define PARAMS(paramlist) paramlist -#define ANSI_PROTOTYPES 1 - -#define VPARAMS(ARGS) ARGS -#define VA_START(va_list,var) va_start(va_list,var) - -/* These are obsolete. Do not use. */ -#ifndef IN_GCC -#define CONST const -#define DOTS , ... -#define PROTO(type, name, arglist) type name arglist -#define EXFUN(name, proto) name proto -#define DEFUN(name, arglist, args) name(args) -#define DEFUN_VOID(name) name(void) -#endif /* ! IN_GCC */ - -#else /* Not ANSI C. */ - -#define PTR char * -#define PTRCONST PTR -#define LONG_DOUBLE double - -#ifndef IN_GCC -#define AND ; -#define NOARGS -#define VOLATILE -#define SIGNED -#endif /* !IN_GCC */ - -#ifndef const /* some systems define it in header files for non-ansi mode */ -#define const -#endif - -#define PARAMS(paramlist) () - -#define VPARAMS(ARGS) (va_alist) va_dcl -#define VA_START(va_list,var) va_start(va_list) - -/* These are obsolete. Do not use. */ -#ifndef IN_GCC -#define CONST -#define DOTS -#define PROTO(type, name, arglist) type name () -#define EXFUN(name, proto) name() -#define DEFUN(name, arglist, args) name arglist args; -#define DEFUN_VOID(name) name() -#endif /* ! IN_GCC */ - -#endif /* ANSI C. */ - -#endif /* ansidecl.h */ diff --git a/gnu/egcs/include/demangle.h b/gnu/egcs/include/demangle.h deleted file mode 100644 index a6234119aff..00000000000 --- a/gnu/egcs/include/demangle.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Defs for interface to demanglers. - Copyright 1992, 1995, 1996 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - - -#if !defined (DEMANGLE_H) -#define DEMANGLE_H - -#include <ansidecl.h> - -/* Options passed to cplus_demangle (in 2nd parameter). */ - -#define DMGL_NO_OPTS 0 /* For readability... */ -#define DMGL_PARAMS (1 << 0) /* Include function args */ -#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ -#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */ - -#define DMGL_AUTO (1 << 8) -#define DMGL_GNU (1 << 9) -#define DMGL_LUCID (1 << 10) -#define DMGL_ARM (1 << 11) -#define DMGL_HP (1 << 12) /* For the HP aCC compiler; same as ARM - except for template arguments, etc. */ -#define DMGL_EDG (1 << 13) - -/* If none of these are set, use 'current_demangling_style' as the default. */ -#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG) - -/* Enumeration of possible demangling styles. - - Lucid and ARM styles are still kept logically distinct, even though - they now both behave identically. The resulting style is actual the - union of both. I.E. either style recognizes both "__pt__" and "__rf__" - for operator "->", even though the first is lucid style and the second - is ARM style. (FIXME?) */ - -extern enum demangling_styles -{ - unknown_demangling = 0, - auto_demangling = DMGL_AUTO, - gnu_demangling = DMGL_GNU, - lucid_demangling = DMGL_LUCID, - arm_demangling = DMGL_ARM, - hp_demangling = DMGL_HP, - edg_demangling = DMGL_EDG -} current_demangling_style; - -/* Define string names for the various demangling styles. */ - -#define AUTO_DEMANGLING_STYLE_STRING "auto" -#define GNU_DEMANGLING_STYLE_STRING "gnu" -#define LUCID_DEMANGLING_STYLE_STRING "lucid" -#define ARM_DEMANGLING_STYLE_STRING "arm" -#define HP_DEMANGLING_STYLE_STRING "hp" -#define EDG_DEMANGLING_STYLE_STRING "edg" - -/* Some macros to test what demangling style is active. */ - -#define CURRENT_DEMANGLING_STYLE current_demangling_style -#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO) -#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU) -#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID) -#define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM) -#define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP) -#define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG) - -/* Provide information about the available demangle styles. This code is - pulled from gdb into libiberty because it is useful to binutils also. */ - -extern struct demangler_engine -{ - const char *demangling_style_name; - enum demangling_styles demangling_style; - const char *demangling_style_doc; -} libiberty_demanglers[]; - -extern char * -cplus_demangle PARAMS ((const char *mangled, int options)); - -extern int -cplus_demangle_opname PARAMS ((const char *opname, char *result, int options)); - -extern const char * -cplus_mangle_opname PARAMS ((const char *opname, int options)); - -/* Note: This sets global state. FIXME if you care about multi-threading. */ - -extern void -set_cplus_marker_for_demangling PARAMS ((int ch)); - -extern enum demangling_styles -cplus_demangle_set_style PARAMS ((enum demangling_styles style)); - -extern enum demangling_styles -cplus_demangle_name_to_style PARAMS ((const char *name)); - -#endif /* DEMANGLE_H */ diff --git a/gnu/egcs/include/dyn-string.h b/gnu/egcs/include/dyn-string.h deleted file mode 100644 index 67f7ab7d36e..00000000000 --- a/gnu/egcs/include/dyn-string.h +++ /dev/null @@ -1,92 +0,0 @@ -/* An abstract string datatype. - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - Contributed by Mark Mitchell (mark@markmitchell.com). - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - - -typedef struct dyn_string -{ - int allocated; /* The amount of space allocated for the string. */ - int length; /* The actual length of the string. */ - char *s; /* The string itself, NUL-terminated. */ -}* dyn_string_t; - -/* The length STR, in bytes, not including the terminating NUL. */ -#define dyn_string_length(STR) \ - ((STR)->length) - -/* The NTBS in which the contents of STR are stored. */ -#define dyn_string_buf(STR) \ - ((STR)->s) - -/* Compare DS1 to DS2 with strcmp. */ -#define dyn_string_compare(DS1, DS2) \ - (strcmp ((DS1)->s, (DS2)->s)) - - -/* dyn_string functions are used in the demangling implementation - included in the G++ runtime library. To prevent collisions with - names in user programs, the functions that are used in the - demangler are given implementation-reserved names. */ - -#ifdef IN_LIBGCC2 - -#define dyn_string_init __cxa_dyn_string_init -#define dyn_string_new __cxa_dyn_string_new -#define dyn_string_delete __cxa_dyn_string_delete -#define dyn_string_release __cxa_dyn_string_release -#define dyn_string_resize __cxa_dyn_string_resize -#define dyn_string_clear __cxa_dyn_string_clear -#define dyn_string_copy __cxa_dyn_string_copy -#define dyn_string_copy_cstr __cxa_dyn_string_copy_cstr -#define dyn_string_prepend __cxa_dyn_string_prepend -#define dyn_string_prepend_cstr __cxa_dyn_string_prepend_cstr -#define dyn_string_insert __cxa_dyn_string_insert -#define dyn_string_insert_cstr __cxa_dyn_string_insert_cstr -#define dyn_string_insert_char __cxa_dyn_string_insert_char -#define dyn_string_append __cxa_dyn_string_append -#define dyn_string_append_cstr __cxa_dyn_string_append_cstr -#define dyn_string_append_char __cxa_dyn_string_append_char -#define dyn_string_substring __cxa_dyn_string_substring -#define dyn_string_eq __cxa_dyn_string_eq - -#endif /* IN_LIBGCC2 */ - - -extern int dyn_string_init PARAMS ((struct dyn_string *, int)); -extern dyn_string_t dyn_string_new PARAMS ((int)); -extern void dyn_string_delete PARAMS ((dyn_string_t)); -extern char *dyn_string_release PARAMS ((dyn_string_t)); -extern dyn_string_t dyn_string_resize PARAMS ((dyn_string_t, int)); -extern void dyn_string_clear PARAMS ((dyn_string_t)); -extern int dyn_string_copy PARAMS ((dyn_string_t, dyn_string_t)); -extern int dyn_string_copy_cstr PARAMS ((dyn_string_t, const char *)); -extern int dyn_string_prepend PARAMS ((dyn_string_t, dyn_string_t)); -extern int dyn_string_prepend_cstr PARAMS ((dyn_string_t, const char *)); -extern int dyn_string_insert PARAMS ((dyn_string_t, int, - dyn_string_t)); -extern int dyn_string_insert_cstr PARAMS ((dyn_string_t, int, - const char *)); -extern int dyn_string_insert_char PARAMS ((dyn_string_t, int, int)); -extern int dyn_string_append PARAMS ((dyn_string_t, dyn_string_t)); -extern int dyn_string_append_cstr PARAMS ((dyn_string_t, const char *)); -extern int dyn_string_append_char PARAMS ((dyn_string_t, int)); -extern int dyn_string_substring PARAMS ((dyn_string_t, - dyn_string_t, int, int)); -extern int dyn_string_eq PARAMS ((dyn_string_t, dyn_string_t)); diff --git a/gnu/egcs/include/floatformat.h b/gnu/egcs/include/floatformat.h deleted file mode 100644 index 90daca21bcb..00000000000 --- a/gnu/egcs/include/floatformat.h +++ /dev/null @@ -1,111 +0,0 @@ -/* IEEE floating point support declarations, for GDB, the GNU Debugger. - Copyright (C) 1991 Free Software Foundation, Inc. - -This file is part of GDB. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if !defined (FLOATFORMAT_H) -#define FLOATFORMAT_H 1 - -#include "ansidecl.h" - -/* A floatformat consists of a sign bit, an exponent and a mantissa. Once the - bytes are concatenated according to the byteorder flag, then each of those - fields is contiguous. We number the bits with 0 being the most significant - (i.e. BITS_BIG_ENDIAN type numbering), and specify which bits each field - contains with the *_start and *_len fields. */ - -/* What is the order of the bytes. */ - -enum floatformat_byteorders { - - /* Standard little endian byte order. - EX: 1.2345678e10 => 00 00 80 c5 e0 fe 06 42 */ - - floatformat_little, - - /* Standard big endian byte order. - EX: 1.2345678e10 => 42 06 fe e0 c5 80 00 00 */ - - floatformat_big, - - /* Little endian byte order but big endian word order. - EX: 1.2345678e10 => e0 fe 06 42 00 00 80 c5 */ - - floatformat_littlebyte_bigword - -}; - -enum floatformat_intbit { floatformat_intbit_yes, floatformat_intbit_no }; - -struct floatformat -{ - enum floatformat_byteorders byteorder; - unsigned int totalsize; /* Total size of number in bits */ - - /* Sign bit is always one bit long. 1 means negative, 0 means positive. */ - unsigned int sign_start; - - unsigned int exp_start; - unsigned int exp_len; - /* Amount added to "true" exponent. 0x3fff for many IEEE extendeds. */ - unsigned int exp_bias; - /* Exponent value which indicates NaN. This is the actual value stored in - the float, not adjusted by the exp_bias. This usually consists of all - one bits. */ - unsigned int exp_nan; - - unsigned int man_start; - unsigned int man_len; - - /* Is the integer bit explicit or implicit? */ - enum floatformat_intbit intbit; -}; - -/* floatformats for IEEE single and double, big and little endian. */ - -extern const struct floatformat floatformat_ieee_single_big; -extern const struct floatformat floatformat_ieee_single_little; -extern const struct floatformat floatformat_ieee_double_big; -extern const struct floatformat floatformat_ieee_double_little; - -/* floatformat for ARM IEEE double, little endian bytes and big endian words */ - -extern const struct floatformat floatformat_ieee_double_littlebyte_bigword; - -/* floatformats for various extendeds. */ - -extern const struct floatformat floatformat_i387_ext; -extern const struct floatformat floatformat_m68881_ext; -extern const struct floatformat floatformat_i960_ext; -extern const struct floatformat floatformat_m88110_ext; -extern const struct floatformat floatformat_arm_ext; - -/* Convert from FMT to a double. - FROM is the address of the extended float. - Store the double in *TO. */ - -extern void -floatformat_to_double PARAMS ((const struct floatformat *, char *, double *)); - -/* The converse: convert the double *FROM to FMT - and store where TO points. */ - -extern void -floatformat_from_double PARAMS ((const struct floatformat *, - double *, char *)); - -#endif /* defined (FLOATFORMAT_H) */ diff --git a/gnu/egcs/include/fnmatch.h b/gnu/egcs/include/fnmatch.h deleted file mode 100644 index d5eb7000977..00000000000 --- a/gnu/egcs/include/fnmatch.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#ifndef _FNMATCH_H - -#define _FNMATCH_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) -#undef __P -#define __P(args) args -#else /* Not C++ or ANSI C. */ -#undef __P -#define __P(args) () -/* We can get away without defining `const' here only because in this file - it is used only inside the prototype for `fnmatch', which is elided in - non-ANSI C where `const' is problematical. */ -#endif /* C++ or ANSI C. */ - - -/* We #undef these before defining them because some losing systems - (HP-UX A.08.07 for example) define these in <unistd.h>. */ -#undef FNM_PATHNAME -#undef FNM_NOESCAPE -#undef FNM_PERIOD - -/* Bits set in the FLAGS argument to `fnmatch'. */ -#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ -#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ -#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ - -#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) -#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ -#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ -#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ -#endif - -/* Value returned by `fnmatch' if STRING does not match PATTERN. */ -#define FNM_NOMATCH 1 - -/* Match STRING against the filename pattern PATTERN, - returning zero if it matches, FNM_NOMATCH if not. */ -extern int fnmatch __P ((const char *__pattern, const char *__string, - int __flags)); - -#ifdef __cplusplus -} -#endif - -#endif /* fnmatch.h */ diff --git a/gnu/egcs/include/getopt.h b/gnu/egcs/include/getopt.h deleted file mode 100644 index fb30719a860..00000000000 --- a/gnu/egcs/include/getopt.h +++ /dev/null @@ -1,133 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. - - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@gnu.org. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if defined (__STDC__) && __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* getopt.h */ diff --git a/gnu/egcs/include/hashtab.h b/gnu/egcs/include/hashtab.h deleted file mode 100644 index 67c37a284f7..00000000000 --- a/gnu/egcs/include/hashtab.h +++ /dev/null @@ -1,103 +0,0 @@ -/* An expandable hash tables datatype. - Copyright (C) 1999 Free Software Foundation, Inc. - Contributed by Vladimir Makarov (vmakarov@cygnus.com). - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* This package implements basic hash table functionality. It is possible - to search for an entry, create an entry and destroy an entry. - - Elements in the table are generic pointers. - - The size of the table is not fixed; if the occupancy of the table - grows too high the hash table will be expanded. - - The abstract data implementation is based on generalized Algorithm D - from Knuth's book "The art of computer programming". Hash table is - expanded by creation of new hash table and transferring elements from - the old table to the new table. */ - -#ifndef __HASHTAB_H__ -#define __HASHTAB_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include <ansidecl.h> - -/* The hash table element is represented by the following type. */ - -typedef const void *hash_table_entry_t; - -/* Hash tables are of the following type. The structure - (implementation) of this type is not needed for using the hash - tables. All work with hash table should be executed only through - functions mentioned below. */ - -typedef struct -{ - /* Current size (in entries) of the hash table */ - size_t size; - /* Current number of elements including also deleted elements */ - size_t number_of_elements; - /* Current number of deleted elements in the table */ - size_t number_of_deleted_elements; - /* The following member is used for debugging. Its value is number - of all calls of `find_hash_table_entry' for the hash table. */ - int searches; - /* The following member is used for debugging. Its value is number - of collisions fixed for time of work with the hash table. */ - int collisions; - /* Pointer to function for evaluation of hash value (any unsigned value). - This function has one parameter of type hash_table_entry_t. */ - unsigned (*hash_function) PARAMS ((hash_table_entry_t)); - /* Pointer to function for test on equality of hash table elements (two - parameter of type hash_table_entry_t. */ - int (*eq_function) PARAMS ((hash_table_entry_t, hash_table_entry_t)); - /* Table itself */ - hash_table_entry_t *entries; -} *hash_table_t; - - -/* The prototypes of the package functions. */ - -extern hash_table_t create_hash_table - PARAMS ((size_t, unsigned (*) (hash_table_entry_t), - int (*) (hash_table_entry_t, hash_table_entry_t))); - -extern void delete_hash_table PARAMS ((hash_table_t)); - -extern void empty_hash_table PARAMS ((hash_table_t)); - -extern hash_table_entry_t *find_hash_table_entry - PARAMS ((hash_table_t, hash_table_entry_t, int)); - -extern void remove_element_from_hash_table_entry PARAMS ((hash_table_t, - hash_table_entry_t)); - -extern size_t hash_table_size PARAMS ((hash_table_t)); - -extern size_t hash_table_elements_number PARAMS ((hash_table_t)); - -extern int hash_table_collisions PARAMS ((hash_table_t)); - -extern int all_hash_table_collisions (); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __HASHTAB_H */ diff --git a/gnu/egcs/include/libiberty.h b/gnu/egcs/include/libiberty.h deleted file mode 100644 index 05114a27b6c..00000000000 --- a/gnu/egcs/include/libiberty.h +++ /dev/null @@ -1,200 +0,0 @@ -/* Function declarations for libiberty. - Written by Cygnus Support, 1994. - - The libiberty library provides a number of functions which are - missing on some operating systems. We do not declare those here, - to avoid conflicts with the system header files on operating - systems that do support those functions. In this file we only - declare those functions which are specific to libiberty. */ - -#ifndef LIBIBERTY_H -#define LIBIBERTY_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "ansidecl.h" - -/* Build an argument vector from a string. Allocates memory using - malloc. Use freeargv to free the vector. */ - -extern char **buildargv PARAMS ((char *)); - -/* Free a vector returned by buildargv. */ - -extern void freeargv PARAMS ((char **)); - -/* Duplicate an argument vector. Allocates memory using malloc. Use - freeargv to free the vector. */ - -extern char **dupargv PARAMS ((char **)); - - -/* Return the last component of a path name. Note that we can't use a - prototype here because the parameter is declared inconsistently - across different systems, sometimes as "char *" and sometimes as - "const char *" */ - -#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) -extern char *basename PARAMS ((const char *)); -#else -extern char *basename (); -#endif - -/* Concatenate an arbitrary number of strings, up to (char *) NULL. - Allocates memory using xmalloc. */ - -extern char *concat PARAMS ((const char *, ...)); - -/* Check whether two file descriptors refer to the same file. */ - -extern int fdmatch PARAMS ((int fd1, int fd2)); - -/* Get the working directory. The result is cached, so don't call - chdir() between calls to getpwd(). */ - -extern char * getpwd PARAMS ((void)); - -/* Get the amount of time the process has run, in microseconds. */ - -extern long get_run_time PARAMS ((void)); - -/* Choose a temporary directory to use for scratch files, DEPRECATED */ - -extern char *choose_temp_base PARAMS ((void)); - -/* Return a temporary file name or NULL if unable to create one. */ - -extern char *make_temp_file PARAMS ((const char *)); - -/* Allocate memory filled with spaces. Allocates using malloc. */ - -extern const char *spaces PARAMS ((int count)); - -/* Return the maximum error number for which strerror will return a - string. */ - -extern int errno_max PARAMS ((void)); - -/* Return the name of an errno value (e.g., strerrno (EINVAL) returns - "EINVAL"). */ - -extern const char *strerrno PARAMS ((int)); - -/* Given the name of an errno value, return the value. */ - -extern int strtoerrno PARAMS ((const char *)); - -/* ANSI's strerror(), but more robust. */ - -extern char *xstrerror PARAMS ((int)); - -/* Return the maximum signal number for which strsignal will return a - string. */ - -extern int signo_max PARAMS ((void)); - -/* Return a signal message string for a signal number - (e.g., strsignal (SIGHUP) returns something like "Hangup"). */ -/* This is commented out as it can conflict with one in system headers. - We still document its existence though. */ - -/*extern const char *strsignal PARAMS ((int));*/ - -/* Return the name of a signal number (e.g., strsigno (SIGHUP) returns - "SIGHUP"). */ - -extern const char *strsigno PARAMS ((int)); - -/* Given the name of a signal, return its number. */ - -extern int strtosigno PARAMS ((const char *)); - -/* Register a function to be run by xexit. Returns 0 on success. */ - -extern int xatexit PARAMS ((void (*fn) (void))); - -/* Exit, calling all the functions registered with xatexit. */ - -extern void xexit PARAMS ((int status)); - -/* Set the program name used by xmalloc. */ - -extern void xmalloc_set_program_name PARAMS ((const char *)); - -/* Allocate memory without fail. If malloc fails, this will print a - message to stderr (using the name set by xmalloc_set_program_name, - if any) and then call xexit. */ - -#ifdef ANSI_PROTOTYPES -/* Get a definition for size_t. */ -#include <stddef.h> -/* Get a definition for va_list. */ -#include <stdarg.h> -#endif -extern PTR xmalloc PARAMS ((size_t)); - -/* Reallocate memory without fail. This works like xmalloc. Note, - realloc type functions are not suitable for attribute malloc since - they may return the same address across multiple calls. */ - -extern PTR xrealloc PARAMS ((PTR, size_t)); - -/* Allocate memory without fail and set it to zero. This works like - xmalloc. */ - -extern PTR xcalloc PARAMS ((size_t, size_t)); - -/* Copy a string into a memory buffer without fail. */ - -extern char *xstrdup PARAMS ((const char *)); - -/* Copy an existing memory buffer to a new memory buffer without fail. */ - -extern PTR xmemdup PARAMS ((const PTR, size_t, size_t)); - -/* hex character manipulation routines */ - -#define _hex_array_size 256 -#define _hex_bad 99 -extern char _hex_value[_hex_array_size]; -extern void hex_init PARAMS ((void)); -#define hex_p(c) (hex_value (c) != _hex_bad) -/* If you change this, note well: Some code relies on side effects in - the argument being performed exactly once. */ -#define hex_value(c) (_hex_value[(unsigned char) (c)]) - -/* Definitions used by the pexecute routine. */ - -#define PEXECUTE_FIRST 1 -#define PEXECUTE_LAST 2 -#define PEXECUTE_ONE (PEXECUTE_FIRST + PEXECUTE_LAST) -#define PEXECUTE_SEARCH 4 -#define PEXECUTE_VERBOSE 8 - -/* Execute a program. */ - -extern int pexecute PARAMS ((const char *, char * const *, const char *, - const char *, char **, char **, int)); - -/* Wait for pexecute to finish. */ - -extern int pwait PARAMS ((int, int *, int)); - -/* Like sprintf but provides a pointer to malloc'd storage, which must - be freed by the caller. */ - -extern int asprintf PARAMS ((char **, const char *, ...)); - -/* Like vsprintf but provides a pointer to malloc'd storage, which - must be freed by the caller. */ - -extern int vasprintf PARAMS ((char **, const char *, va_list)); - -#ifdef __cplusplus -} -#endif - - -#endif /* ! defined (LIBIBERTY_H) */ diff --git a/gnu/egcs/include/objalloc.h b/gnu/egcs/include/objalloc.h deleted file mode 100644 index 0b451cdc295..00000000000 --- a/gnu/egcs/include/objalloc.h +++ /dev/null @@ -1,116 +0,0 @@ -/* objalloc.h -- routines to allocate memory for objects - Copyright 1997 Free Software Foundation, Inc. - Written by Ian Lance Taylor, Cygnus Solutions. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#ifndef OBJALLOC_H -#define OBJALLOC_H - -#include "ansidecl.h" - -/* These routines allocate space for an object. The assumption is - that the object will want to allocate space as it goes along, but - will never want to free any particular block. There is a function - to free a block, which also frees all more recently allocated - blocks. There is also a function to free all the allocated space. - - This is essentially a specialization of obstacks. The main - difference is that a block may not be allocated a bit at a time. - Another difference is that these routines are always built on top - of malloc, and always pass an malloc failure back to the caller, - unlike more recent versions of obstacks. */ - -/* This is what an objalloc structure looks like. Callers should not - refer to these fields, nor should they allocate these structure - themselves. Instead, they should only create them via - objalloc_init, and only access them via the functions and macros - listed below. The structure is only defined here so that we can - access it via macros. */ - -struct objalloc -{ - char *current_ptr; - unsigned int current_space; - PTR chunks; -}; - -/* Work out the required alignment. */ - -struct objalloc_align { char x; double d; }; - -#if defined (__STDC__) && __STDC__ -#ifndef offsetof -#include <stddef.h> -#endif -#define OBJALLOC_ALIGN \ - ((ptrdiff_t) ((char *) &((struct objalloc_align *) 0)->d - (char *) 0)) -#else -#define OBJALLOC_ALIGN \ - ((long) ((char *) &((struct objalloc_align *) 0)->d - (char *) 0)) -#endif - -/* Create an objalloc structure. Returns NULL if malloc fails. */ - -extern struct objalloc *objalloc_create PARAMS ((void)); - -/* Allocate space from an objalloc structure. Returns NULL if malloc - fails. */ - -extern PTR _objalloc_alloc PARAMS ((struct objalloc *, unsigned long)); - -/* The macro version of objalloc_alloc. We only define this if using - gcc, because otherwise we would have to evaluate the arguments - multiple times, or use a temporary field as obstack.h does. */ - -#if defined (__GNUC__) && defined (__STDC__) && __STDC__ - -/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and - does not implement __extension__. But that compiler doesn't define - __GNUC_MINOR__. */ -#if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__) -#define __extension__ -#endif - -#define objalloc_alloc(o, l) \ - __extension__ \ - ({ struct objalloc *__o = (o); \ - unsigned long __len = (l); \ - if (__len == 0) \ - __len = 1; \ - __len = (__len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); \ - (__len <= __o->current_space \ - ? (__o->current_ptr += __len, \ - __o->current_space -= __len, \ - (PTR) (__o->current_ptr - __len)) \ - : _objalloc_alloc (__o, __len)); }) - -#else /* ! __GNUC__ */ - -#define objalloc_alloc(o, l) _objalloc_alloc ((o), (l)) - -#endif /* ! __GNUC__ */ - -/* Free an entire objalloc structure. */ - -extern void objalloc_free PARAMS ((struct objalloc *)); - -/* Free a block allocated by objalloc_alloc. This also frees all more - recently allocated blocks. */ - -extern void objalloc_free_block PARAMS ((struct objalloc *, PTR)); - -#endif /* OBJALLOC_H */ diff --git a/gnu/egcs/include/obstack.h b/gnu/egcs/include/obstack.h deleted file mode 100644 index a20ab55967a..00000000000 --- a/gnu/egcs/include/obstack.h +++ /dev/null @@ -1,597 +0,0 @@ -/* obstack.h - object stack macros - Copyright (C) 1988,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. - - - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@gnu.org. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -/* Summary: - -All the apparent functions defined here are macros. The idea -is that you would use these pre-tested macros to solve a -very specific set of problems, and they would run fast. -Caution: no side-effects in arguments please!! They may be -evaluated MANY times!! - -These macros operate a stack of objects. Each object starts life -small, and may grow to maturity. (Consider building a word syllable -by syllable.) An object can move while it is growing. Once it has -been "finished" it never changes address again. So the "top of the -stack" is typically an immature growing object, while the rest of the -stack is of mature, fixed size and fixed address objects. - -These routines grab large chunks of memory, using a function you -supply, called `obstack_chunk_alloc'. On occasion, they free chunks, -by calling `obstack_chunk_free'. You must define them and declare -them before using any obstack macros. - -Each independent stack is represented by a `struct obstack'. -Each of the obstack macros expects a pointer to such a structure -as the first argument. - -One motivation for this package is the problem of growing char strings -in symbol tables. Unless you are "fascist pig with a read-only mind" ---Gosper's immortal quote from HAKMEM item 154, out of context--you -would not like to put any arbitrary upper limit on the length of your -symbols. - -In practice this often means you will build many short symbols and a -few long symbols. At the time you are reading a symbol you don't know -how long it is. One traditional method is to read a symbol into a -buffer, realloc()ating the buffer every time you try to read a symbol -that is longer than the buffer. This is beaut, but you still will -want to copy the symbol from the buffer to a more permanent -symbol-table entry say about half the time. - -With obstacks, you can work differently. Use one obstack for all symbol -names. As you read a symbol, grow the name in the obstack gradually. -When the name is complete, finalize it. Then, if the symbol exists already, -free the newly read name. - -The way we do this is to take a large chunk, allocating memory from -low addresses. When you want to build a symbol in the chunk you just -add chars above the current "high water mark" in the chunk. When you -have finished adding chars, because you got to the end of the symbol, -you know how long the chars are, and you can create a new object. -Mostly the chars will not burst over the highest address of the chunk, -because you would typically expect a chunk to be (say) 100 times as -long as an average object. - -In case that isn't clear, when we have enough chars to make up -the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed) -so we just point to it where it lies. No moving of chars is -needed and this is the second win: potentially long strings need -never be explicitly shuffled. Once an object is formed, it does not -change its address during its lifetime. - -When the chars burst over a chunk boundary, we allocate a larger -chunk, and then copy the partly formed object from the end of the old -chunk to the beginning of the new larger chunk. We then carry on -accreting characters to the end of the object as we normally would. - -A special macro is provided to add a single char at a time to a -growing object. This allows the use of register variables, which -break the ordinary 'growth' macro. - -Summary: - We allocate large chunks. - We carve out one object at a time from the current chunk. - Once carved, an object never moves. - We are free to append data of any size to the currently - growing object. - Exactly one object is growing in an obstack at any one time. - You can run one obstack per control block. - You may have as many control blocks as you dare. - Because of the way we do it, you can `unwind' an obstack - back to a previous state. (You may remove objects much - as you would with a stack.) -*/ - - -/* Don't do the contents of this file more than once. */ - -#ifndef _OBSTACK_H -#define _OBSTACK_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* We use subtraction of (char *) 0 instead of casting to int - because on word-addressable machines a simple cast to int - may ignore the byte-within-word field of the pointer. */ - -#ifndef __PTR_TO_INT -# define __PTR_TO_INT(P) ((P) - (char *) 0) -#endif - -#ifndef __INT_TO_PTR -# define __INT_TO_PTR(P) ((P) + (char *) 0) -#endif - -/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is - defined, as with GNU C, use that; that way we don't pollute the - namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is - available, include it and use ptrdiff_t. In traditional C, long is - the best that we can do. */ - -#ifdef __PTRDIFF_TYPE__ -# define PTR_INT_TYPE __PTRDIFF_TYPE__ -#else -# ifdef HAVE_STDDEF_H -# include <stddef.h> -# define PTR_INT_TYPE ptrdiff_t -# else -# define PTR_INT_TYPE long -# endif -#endif - -#if defined _LIBC || defined HAVE_STRING_H -# include <string.h> -# if defined __STDC__ && __STDC__ -# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N)) -# else -# define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N)) -# endif -#else -# ifdef memcpy -# define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N)) -# else -# define _obstack_memcpy(To, From, N) bcopy ((char *)(From), (To), (N)) -# endif -#endif - -struct _obstack_chunk /* Lives at front of each chunk. */ -{ - char *limit; /* 1 past end of this chunk */ - struct _obstack_chunk *prev; /* address of prior chunk or NULL */ - char contents[4]; /* objects begin here */ -}; - -struct obstack /* control current object in current chunk */ -{ - long chunk_size; /* preferred size to allocate chunks in */ - struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */ - char *object_base; /* address of object we are building */ - char *next_free; /* where to add next char to current object */ - char *chunk_limit; /* address of char after current chunk */ - PTR_INT_TYPE temp; /* Temporary for some macros. */ - int alignment_mask; /* Mask of alignment for each object. */ -#if defined __STDC__ && __STDC__ - /* These prototypes vary based on `use_extra_arg', and we use - casts to the prototypeless function type in all assignments, - but having prototypes here quiets -Wstrict-prototypes. */ - struct _obstack_chunk *(*chunkfun) (void *, long); - void (*freefun) (void *, struct _obstack_chunk *); - void *extra_arg; /* first arg for chunk alloc/dealloc funcs */ -#else - struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */ - void (*freefun) (); /* User's function to free a chunk. */ - char *extra_arg; /* first arg for chunk alloc/dealloc funcs */ -#endif - unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */ - unsigned maybe_empty_object:1;/* There is a possibility that the current - chunk contains a zero-length object. This - prevents freeing the chunk if we allocate - a bigger chunk to replace it. */ - unsigned alloc_failed:1; /* No longer used, as we now call the failed - handler on error, but retained for binary - compatibility. */ -}; - -/* Declare the external functions we use; they are in obstack.c. */ - -#if defined __STDC__ && __STDC__ -extern void _obstack_newchunk (struct obstack *, int); -extern void _obstack_free (struct obstack *, void *); -extern int _obstack_begin (struct obstack *, int, int, - void *(*) (long), void (*) (void *)); -extern int _obstack_begin_1 (struct obstack *, int, int, - void *(*) (void *, long), - void (*) (void *, void *), void *); -extern int _obstack_memory_used (struct obstack *); -#else -extern void _obstack_newchunk (); -extern void _obstack_free (); -extern int _obstack_begin (); -extern int _obstack_begin_1 (); -extern int _obstack_memory_used (); -#endif - -#if defined __STDC__ && __STDC__ - -/* Do the function-declarations after the structs - but before defining the macros. */ - -void obstack_init (struct obstack *obstack); - -void * obstack_alloc (struct obstack *obstack, int size); - -void * obstack_copy (struct obstack *obstack, void *address, int size); -void * obstack_copy0 (struct obstack *obstack, void *address, int size); - -void obstack_free (struct obstack *obstack, void *block); - -void obstack_blank (struct obstack *obstack, int size); - -void obstack_grow (struct obstack *obstack, void *data, int size); -void obstack_grow0 (struct obstack *obstack, void *data, int size); - -void obstack_1grow (struct obstack *obstack, int data_char); -void obstack_ptr_grow (struct obstack *obstack, void *data); -void obstack_int_grow (struct obstack *obstack, int data); - -void * obstack_finish (struct obstack *obstack); - -int obstack_object_size (struct obstack *obstack); - -int obstack_room (struct obstack *obstack); -void obstack_make_room (struct obstack *obstack, int size); -void obstack_1grow_fast (struct obstack *obstack, int data_char); -void obstack_ptr_grow_fast (struct obstack *obstack, void *data); -void obstack_int_grow_fast (struct obstack *obstack, int data); -void obstack_blank_fast (struct obstack *obstack, int size); - -void * obstack_base (struct obstack *obstack); -void * obstack_next_free (struct obstack *obstack); -int obstack_alignment_mask (struct obstack *obstack); -int obstack_chunk_size (struct obstack *obstack); -int obstack_memory_used (struct obstack *obstack); - -#endif /* __STDC__ */ - -/* Non-ANSI C cannot really support alternative functions for these macros, - so we do not declare them. */ - -/* Error handler called when `obstack_chunk_alloc' failed to allocate - more memory. This can be set to a user defined function. The - default action is to print a message and abort. */ -#if defined __STDC__ && __STDC__ -extern void (*obstack_alloc_failed_handler) (void); -#else -extern void (*obstack_alloc_failed_handler) (); -#endif - -/* Exit value used when `print_and_abort' is used. */ -extern int obstack_exit_failure; - -/* Pointer to beginning of object being allocated or to be allocated next. - Note that this might not be the final address of the object - because a new chunk might be needed to hold the final size. */ - -#define obstack_base(h) ((h)->object_base) - -/* Size for allocating ordinary chunks. */ - -#define obstack_chunk_size(h) ((h)->chunk_size) - -/* Pointer to next byte not yet allocated in current chunk. */ - -#define obstack_next_free(h) ((h)->next_free) - -/* Mask specifying low bits that should be clear in address of an object. */ - -#define obstack_alignment_mask(h) ((h)->alignment_mask) - -/* To prevent prototype warnings provide complete argument list in - standard C version. */ -#if defined __STDC__ && __STDC__ - -# define obstack_init(h) \ - _obstack_begin ((h), 0, 0, \ - (void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free) - -# define obstack_begin(h, size) \ - _obstack_begin ((h), (size), 0, \ - (void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free) - -# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \ - _obstack_begin ((h), (size), (alignment), \ - (void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun)) - -# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \ - _obstack_begin_1 ((h), (size), (alignment), \ - (void *(*) (void *, long)) (chunkfun), \ - (void (*) (void *, void *)) (freefun), (arg)) - -# define obstack_chunkfun(h, newchunkfun) \ - ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun)) - -# define obstack_freefun(h, newfreefun) \ - ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun)) - -#else - -# define obstack_init(h) \ - _obstack_begin ((h), 0, 0, \ - (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free) - -# define obstack_begin(h, size) \ - _obstack_begin ((h), (size), 0, \ - (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free) - -# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \ - _obstack_begin ((h), (size), (alignment), \ - (void *(*) ()) (chunkfun), (void (*) ()) (freefun)) - -# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \ - _obstack_begin_1 ((h), (size), (alignment), \ - (void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg)) - -# define obstack_chunkfun(h, newchunkfun) \ - ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun)) - -# define obstack_freefun(h, newfreefun) \ - ((h) -> freefun = (void (*)()) (newfreefun)) - -#endif - -#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar) - -#define obstack_blank_fast(h,n) ((h)->next_free += (n)) - -#define obstack_memory_used(h) _obstack_memory_used (h) - -#if defined __GNUC__ && defined __STDC__ && __STDC__ -/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and - does not implement __extension__. But that compiler doesn't define - __GNUC_MINOR__. */ -# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__) -# define __extension__ -# endif - -/* For GNU C, if not -traditional, - we can define these macros to compute all args only once - without using a global variable. - Also, we can avoid using the `temp' slot, to make faster code. */ - -# define obstack_object_size(OBSTACK) \ - __extension__ \ - ({ struct obstack *__o = (OBSTACK); \ - (unsigned) (__o->next_free - __o->object_base); }) - -# define obstack_room(OBSTACK) \ - __extension__ \ - ({ struct obstack *__o = (OBSTACK); \ - (unsigned) (__o->chunk_limit - __o->next_free); }) - -# define obstack_make_room(OBSTACK,length) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - int __len = (length); \ - if (__o->chunk_limit - __o->next_free < __len) \ - _obstack_newchunk (__o, __len); \ - (void) 0; }) - -# define obstack_empty_p(OBSTACK) \ - __extension__ \ - ({ struct obstack *__o = (OBSTACK); \ - (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); }) - -# define obstack_grow(OBSTACK,where,length) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - int __len = (length); \ - if (__o->next_free + __len > __o->chunk_limit) \ - _obstack_newchunk (__o, __len); \ - _obstack_memcpy (__o->next_free, (where), __len); \ - __o->next_free += __len; \ - (void) 0; }) - -# define obstack_grow0(OBSTACK,where,length) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - int __len = (length); \ - if (__o->next_free + __len + 1 > __o->chunk_limit) \ - _obstack_newchunk (__o, __len + 1); \ - _obstack_memcpy (__o->next_free, (where), __len); \ - __o->next_free += __len; \ - *(__o->next_free)++ = 0; \ - (void) 0; }) - -# define obstack_1grow(OBSTACK,datum) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - if (__o->next_free + 1 > __o->chunk_limit) \ - _obstack_newchunk (__o, 1); \ - *(__o->next_free)++ = (datum); \ - (void) 0; }) - -/* These assume that the obstack alignment is good enough for pointers or ints, - and that the data added so far to the current object - shares that much alignment. */ - -# define obstack_ptr_grow(OBSTACK,datum) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ - _obstack_newchunk (__o, sizeof (void *)); \ - *((void **)__o->next_free)++ = ((void *)datum); \ - (void) 0; }) - -# define obstack_int_grow(OBSTACK,datum) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - if (__o->next_free + sizeof (int) > __o->chunk_limit) \ - _obstack_newchunk (__o, sizeof (int)); \ - *((int *)__o->next_free)++ = ((int)datum); \ - (void) 0; }) - -# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr) -# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint) - -# define obstack_blank(OBSTACK,length) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - int __len = (length); \ - if (__o->chunk_limit - __o->next_free < __len) \ - _obstack_newchunk (__o, __len); \ - __o->next_free += __len; \ - (void) 0; }) - -# define obstack_alloc(OBSTACK,length) \ -__extension__ \ -({ struct obstack *__h = (OBSTACK); \ - obstack_blank (__h, (length)); \ - obstack_finish (__h); }) - -# define obstack_copy(OBSTACK,where,length) \ -__extension__ \ -({ struct obstack *__h = (OBSTACK); \ - obstack_grow (__h, (where), (length)); \ - obstack_finish (__h); }) - -# define obstack_copy0(OBSTACK,where,length) \ -__extension__ \ -({ struct obstack *__h = (OBSTACK); \ - obstack_grow0 (__h, (where), (length)); \ - obstack_finish (__h); }) - -/* The local variable is named __o1 to avoid a name conflict - when obstack_blank is called. */ -# define obstack_finish(OBSTACK) \ -__extension__ \ -({ struct obstack *__o1 = (OBSTACK); \ - void *value; \ - value = (void *) __o1->object_base; \ - if (__o1->next_free == value) \ - __o1->maybe_empty_object = 1; \ - __o1->next_free \ - = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\ - & ~ (__o1->alignment_mask)); \ - if (__o1->next_free - (char *)__o1->chunk \ - > __o1->chunk_limit - (char *)__o1->chunk) \ - __o1->next_free = __o1->chunk_limit; \ - __o1->object_base = __o1->next_free; \ - value; }) - -# define obstack_free(OBSTACK, OBJ) \ -__extension__ \ -({ struct obstack *__o = (OBSTACK); \ - void *__obj = (OBJ); \ - if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \ - __o->next_free = __o->object_base = __obj; \ - else (obstack_free) (__o, __obj); }) - -#else /* not __GNUC__ or not __STDC__ */ - -# define obstack_object_size(h) \ - (unsigned) ((h)->next_free - (h)->object_base) - -# define obstack_room(h) \ - (unsigned) ((h)->chunk_limit - (h)->next_free) - -# define obstack_empty_p(h) \ - ((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0) - -/* Note that the call to _obstack_newchunk is enclosed in (..., 0) - so that we can avoid having void expressions - in the arms of the conditional expression. - Casting the third operand to void was tried before, - but some compilers won't accept it. */ - -# define obstack_make_room(h,length) \ -( (h)->temp = (length), \ - (((h)->next_free + (h)->temp > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), (h)->temp), 0) : 0)) - -# define obstack_grow(h,where,length) \ -( (h)->temp = (length), \ - (((h)->next_free + (h)->temp > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \ - _obstack_memcpy ((h)->next_free, (where), (h)->temp), \ - (h)->next_free += (h)->temp) - -# define obstack_grow0(h,where,length) \ -( (h)->temp = (length), \ - (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \ - _obstack_memcpy ((h)->next_free, (where), (h)->temp), \ - (h)->next_free += (h)->temp, \ - *((h)->next_free)++ = 0) - -# define obstack_1grow(h,datum) \ -( (((h)->next_free + 1 > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), 1), 0) : 0), \ - (*((h)->next_free)++ = (datum))) - -# define obstack_ptr_grow(h,datum) \ -( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ - (*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum))) - -# define obstack_int_grow(h,datum) \ -( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ - (*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum))) - -# define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr) -# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint) - -# define obstack_blank(h,length) \ -( (h)->temp = (length), \ - (((h)->chunk_limit - (h)->next_free < (h)->temp) \ - ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \ - ((h)->next_free += (h)->temp)) - -# define obstack_alloc(h,length) \ - (obstack_blank ((h), (length)), obstack_finish ((h))) - -# define obstack_copy(h,where,length) \ - (obstack_grow ((h), (where), (length)), obstack_finish ((h))) - -# define obstack_copy0(h,where,length) \ - (obstack_grow0 ((h), (where), (length)), obstack_finish ((h))) - -# define obstack_finish(h) \ -( ((h)->next_free == (h)->object_base \ - ? (((h)->maybe_empty_object = 1), 0) \ - : 0), \ - (h)->temp = __PTR_TO_INT ((h)->object_base), \ - (h)->next_free \ - = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \ - & ~ ((h)->alignment_mask)), \ - (((h)->next_free - (char *) (h)->chunk \ - > (h)->chunk_limit - (char *) (h)->chunk) \ - ? ((h)->next_free = (h)->chunk_limit) : 0), \ - (h)->object_base = (h)->next_free, \ - __INT_TO_PTR ((h)->temp)) - -# if defined __STDC__ && __STDC__ -# define obstack_free(h,obj) \ -( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \ - (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ - ? (int) ((h)->next_free = (h)->object_base \ - = (h)->temp + (char *) (h)->chunk) \ - : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0))) -# else -# define obstack_free(h,obj) \ -( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \ - (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ - ? (int) ((h)->next_free = (h)->object_base \ - = (h)->temp + (char *) (h)->chunk) \ - : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0))) -# endif - -#endif /* not __GNUC__ or not __STDC__ */ - -#ifdef __cplusplus -} /* C++ */ -#endif - -#endif /* obstack.h */ diff --git a/gnu/egcs/include/partition.h b/gnu/egcs/include/partition.h deleted file mode 100644 index f49d67a8cad..00000000000 --- a/gnu/egcs/include/partition.h +++ /dev/null @@ -1,81 +0,0 @@ -/* List implentation of a partition of consecutive integers. - Copyright (C) 2000 Free Software Foundation, Inc. - Contributed by CodeSourcery, LLC. - - This file is part of GNU CC. - - GNU CC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GNU CC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNU CC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This package implements a partition of consecutive integers. The - elements are partitioned into classes. Each class is represented - by one of its elements, the canonical element, which is chosen - arbitrarily from elements in the class. The principal operations - on a partition are FIND, which takes an element, determines its - class, and returns the canonical element for that class, and UNION, - which unites the two classes that contain two given elements into a - single class. - - The list implementation used here provides constant-time finds. By - storing the size of each class with the class's canonical element, - it is able to perform unions over all the classes in the partition - in O (N log N) time. */ - -#ifndef _PARTITION_H -#define _PARTITION_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include <ansidecl.h> -#include <stdio.h> - -struct partition_elem -{ - /* The canonical element that represents the class containing this - element. */ - int class_element; - /* The next element in this class. Elements in each class form a - circular list. */ - struct partition_elem* next; - /* The number of elements in this class. Valid only if this is the - canonical element for its class. */ - unsigned class_count; -}; - -typedef struct partition_def -{ - /* The number of elements in this partition. */ - int num_elements; - /* The elements in the partition. */ - struct partition_elem elements[1]; -} *partition; - -extern partition partition_new PARAMS((int)); -extern void partition_delete PARAMS((partition)); -extern int partition_union PARAMS((partition, - int, - int)); -extern void partition_print PARAMS((partition, - FILE*)); - -/* Returns the canonical element corresponding to the class containing - ELEMENT__ in PARTITION__. */ - -#define partition_find(partition__, element__) \ - ((partition__)->elements[(element__)].class_element) - -#endif /* _PARTITION_H */ diff --git a/gnu/egcs/include/splay-tree.h b/gnu/egcs/include/splay-tree.h deleted file mode 100644 index 6d70c8d9075..00000000000 --- a/gnu/egcs/include/splay-tree.h +++ /dev/null @@ -1,117 +0,0 @@ -/* A splay-tree datatype. - Copyright (C) 1998 Free Software Foundation, Inc. - Contributed by Mark Mitchell (mark@markmitchell.com). - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* For an easily readable description of splay-trees, see: - - Lewis, Harry R. and Denenberg, Larry. Data Structures and Their - Algorithms. Harper-Collins, Inc. 1991. - - The major feature of splay trees is that all basic tree operations - are amortized O(log n) time for a tree with n nodes. */ - -#ifndef _SPLAY_TREE_H -#define _SPLAY_TREE_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include <ansidecl.h> - -/* Use typedefs for the key and data types to facilitate changing - these types, if necessary. These types should be sufficiently wide - that any pointer or scalar can be cast to these types, and then - cast back, without loss of precision. */ -typedef unsigned long int splay_tree_key; -typedef unsigned long int splay_tree_value; - -/* Forward declaration for a node in the tree. */ -typedef struct splay_tree_node_s *splay_tree_node; - -/* The type of a function which compares two splay-tree keys. The - function should return values as for qsort. */ -typedef int (*splay_tree_compare_fn) PARAMS((splay_tree_key, splay_tree_key)); - -/* The type of a function used to deallocate any resources associated - with the key. */ -typedef void (*splay_tree_delete_key_fn) PARAMS((splay_tree_key)); - -/* The type of a function used to deallocate any resources associated - with the value. */ -typedef void (*splay_tree_delete_value_fn) PARAMS((splay_tree_value)); - -/* The type of a function used to iterate over the tree. */ -typedef int (*splay_tree_foreach_fn) PARAMS((splay_tree_node, void*)); - -/* The nodes in the splay tree. */ -struct splay_tree_node_s -{ - /* The key. */ - splay_tree_key key; - - /* The value. */ - splay_tree_value value; - - /* The left and right children, respectively. */ - splay_tree_node left; - splay_tree_node right; -}; - -/* The splay tree itself. */ -typedef struct splay_tree_s -{ - /* The root of the tree. */ - splay_tree_node root; - - /* The comparision function. */ - splay_tree_compare_fn comp; - - /* The deallocate-key function. NULL if no cleanup is necessary. */ - splay_tree_delete_key_fn delete_key; - - /* The deallocate-value function. NULL if no cleanup is necessary. */ - splay_tree_delete_value_fn delete_value; -} *splay_tree; - -extern splay_tree splay_tree_new PARAMS((splay_tree_compare_fn, - splay_tree_delete_key_fn, - splay_tree_delete_value_fn)); -extern void splay_tree_delete PARAMS((splay_tree)); -extern splay_tree_node splay_tree_insert - PARAMS((splay_tree, - splay_tree_key, - splay_tree_value)); -extern splay_tree_node splay_tree_lookup - PARAMS((splay_tree, - splay_tree_key)); -extern int splay_tree_foreach PARAMS((splay_tree, - splay_tree_foreach_fn, - void*)); -extern int splay_tree_compare_ints PARAMS((splay_tree_key, - splay_tree_key)); -extern int splay_tree_compare_pointers PARAMS((splay_tree_key, - splay_tree_key)); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _SPLAY_TREE_H */ diff --git a/gnu/egcs/include/symcat.h b/gnu/egcs/include/symcat.h deleted file mode 100644 index 3e27162b264..00000000000 --- a/gnu/egcs/include/symcat.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Symbol concatenation utilities. - - Copyright (C) 1998, 2000 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef SYM_CAT_H -#define SYM_CAT_H - -#if defined (__STDC__) || defined (ALMOST_STDC) -#define CONCAT2(a,b) a##b -#define CONCAT3(a,b,c) a##b##c -#define CONCAT4(a,b,c,d) a##b##c##d -#define STRINGX(s) #s -#else -#define CONCAT2(a,b) a/**/b -#define CONCAT3(a,b,c) a/**/b/**/c -#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d -#define STRINGX(s) "s" -#endif - -#define XCONCAT2(a,b) CONCAT2(a,b) -#define XCONCAT3(a,b,c) CONCAT3(a,b,c) -#define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d) - -#define XSTRING(s) STRINGX(s) - -#endif SYM_CAT_H diff --git a/gnu/egcs/libiberty/COPYING.LIB b/gnu/egcs/libiberty/COPYING.LIB deleted file mode 100644 index 161a3d1d47b..00000000000 --- a/gnu/egcs/libiberty/COPYING.LIB +++ /dev/null @@ -1,482 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/gnu/egcs/libiberty/ChangeLog b/gnu/egcs/libiberty/ChangeLog deleted file mode 100644 index c858409d301..00000000000 --- a/gnu/egcs/libiberty/ChangeLog +++ /dev/null @@ -1,3615 +0,0 @@ -Thu Mar 16 01:33:58 2000 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (partition.o): Depend on config.h - -2000-03-14 Bernd Schmidt <bernds@cygnus.co.uk> - - * hashtab.c (find_empty_slot_for_expand): New function. - (htab_expand): Use it instead of htab_find_slot. - (htab_find_with_hash): Renamed from htab_find; now accepts extra - argument HASH. - (htab_find_slot_with_hash): Likewise for htab_find_slot. - (htab_find): New wrapper function. - (htab_find_slot): Likewise. - (htab_traverse): Pass slot, not entry, to called function. - -2000-03-09 Alex Samuel <samuel@codesourcery.com> - - * Makefile.in (CFILES): Add partition.c. - (REQUIRED_OFILES): Add partition.o. - (partition.o): New rule. - * partition.c: New file. - -2000-03-09 Zack Weinberg <zack@wolery.cumb.org> - - * hashtab.c (htab_create): Set del_f. - (htab_delete, htab_empty, htab_remove_elt, htab_clear_slot): - Use it. - -2000-03-08 Zack Weinberg <zack@wolery.cumb.org> - - * hashtab.c: Remove debugging variables (all_searches, - all_collisions, all_expansions). Delete - all_hash_table_collisions. - (create_hash_table, delete_hash_table, empty_hash_table, - find_hash_table_entry, remove_element_from_hash_table_entry, - clear_hash_table_slot, traverse_hash_table, hash_table_size, - hash_table_elements_number, hash_table_collisions): Rename to: - htab_create, htab_delete, htab_empty, htab_find_slot, - htab_remove_elt, htab_clear_slot, htab_traverse, htab_size, - htab_elements, htab_collisions. - (htab_find): New function, handles common case where you don't - plan to add or delete an entry. - (htab_expand): Don't create a whole new table, just a new - entry vector. - (htab_find_slot): Simplify logic. - -1999-08-03 Ian Lance Taylor <ian@zembu.com> - - * floatformat.c: Add casts to avoid signed/unsigned warnings. - * pexecute.c: Add ATTRIBUTE_UNUSED as needed on Unix. - - * Makefile.in (install_to_libdir): Change $(TARGETLIB).n to - $(TARGETLIB)n so it works on MSDOS. - (install_to_tooldir): Likewise. - -1999-07-21 Ian Lance Taylor <ian@zembu.com> - - From Mark Elbrecht: - * makefile.dos: Remove; obsolete. - * configure.bat: Remove; obsolete. - -1999-07-11 Ian Lance Taylor <ian@zembu.com> - - * splay-tree.c (splay_tree_insert): Add initialization to avoid - warning. - -2000-01-04 Mumit Khan <khan@xraylith.wisc.edu> - - * pexecute.c: Conditionally include string.h. - (fix_argv): Handle embedded whitespace in args for Mingw32. - -2000-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * configure.in (ac_libiberty_warn_cflags): Turn on warnings if - we're using gcc. - - * Makefile.in (COMPILE.c): Add @ac_libiberty_warn_cflags@ - -1999-12-27 Geoff Keating <geoffk@cygnus.com> - - * vasprintf.c (int_vasprintf): Don't re-read the format character - as this mishandles strings like '%%s'. - -1999-12-05 Mark Mitchell <mark@codesourcery.com> - - * splay-tree.c (splay_tree_new): Use struct splay_tree_node_s - rather than struct splay_tree_node. - (splay_tree_insert): Use struct splay_tree_s rather than struct - splay_tree. - -Sun Nov 28 00:59:39 1999 Philippe De Muyter <phdm@macqel.be> - - * hashtab.c (sys/types.h): File included. - -1999-11-22 Jason Merrill <jason@casey.cygnus.com> - - * strtoul.c, strtol.c, random.c: Remove advertising clause from - BSD license, pursuant with - - ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change - -Wed Nov 10 09:42:39 1999 Jeffrey A Law (law@cygnus.com) - - * hashtab.c: Include stdio.h. - -Mon Nov 8 09:23:41 1999 Jeffrey A Law (law@cygnus.com) - - * hashtab.c (traverse_hash_table): Protect prototype with PARAMS. - -Tue Nov 2 03:23:13 1999 Philippe De Muyter <phdm@macqel.be> - - * xstrdup (sys/types.h): Include this file. - -1999-10-28 Nathan Sidwell <nathan@acm.org> - - * Makefile.in (SUBDIRS): New macro. - (mostlyclean, clean, distclean, maintainer-clean): Adjust to - avoid multiple subdirectory cleaning. - (*-subdir): Use SUBDIRS. - -1999-10-25 Jim Kingdon <http://developer.redhat.com/> - - * cplus-dem.c: Move declarations of standard_symbol_characters and - hp_symbol_characters inside #ifdef MAIN to avoid compiler - warnings. - -1999-10-23 08:51 -0700 Zack Weinberg <zack@bitmover.com> - - * hashtab.c (find_hash_table_entry): When returning a - DELETED_ENTRY slot, change it to EMPTY_ENTRY first. - (clear_hash_table_slot): New function which deletes an entry - by its position in the table, not its value. - (traverse_hash_table): New function which calls a hook - function for every live entry in the table. - -1999-10-19 Mark Mitchell <mark@codesourcery.com> - - * cplus-dem.c (INTBUF_SIZE): New macro. - (string_append_template_idx): New function. - (demangle_expression): Likewise. - (demangle_integral_value): Use it. - (demangle_real_value): New function, split out from ... - (demangle_template_value_parm): ... here. Use - string_append_template_idx. Use demangle_real_value. - (demangle_template): Use string_append_template_idx. - (demangle_qualified): Use consume_count_with_underscores. - (get_count): Tweak formatting. - (do_type): Use string_append_template_idx. - -1999-10-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * calloc.c: Add a public domain notice. - -Mon Oct 18 02:30:47 1999 Philippe De Muyter <phdm@macqel.be> - - * setenv.c (sys/types.h, stdio.h): Include those files unconditionaly. - -Fri Oct 15 01:47:51 1999 Vladimir Makarov <vmakarov@loony.cygnus.com> - - * Makefile.in (CFILES): Add hashtab.c - (REQUIRED_OFILES): Add hashtab.o - (hashtab.o): Add dependencies. - * hashtab.c: New file - -Wed Oct 13 01:16:47 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * basename.c (DIR_SEPARATOR): New macro. - (DIR_SEPARATOR_2): Likewise. - (HAVE_DOS_BASED_FILESYSTEM): Likewise. - (IS_DIR_SEPARATOR): Likewise. - (main): Handle MSDOS style pathname. - -1999-10-11 Mark Mitchell <mark@codesourcery.com> - - * cplus-dem.c (do_type): Handle pointer to member types whose - enclosing classes have namespace scope. - -Sun Oct 10 01:23:50 1999 Marc Espie <espie@cvs.openbsd.org> - - * config.table: Provide a backup shell for executing move-if-change. - -1999-10-02 Mark Mitchell <mark@codesourcery.com> - - * xmalloc.c (xmalloc): Fix spelling error. - (xcalloc, xrealloc): Likewise. - -1999-10-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * cplus-dem.c (fancy_abort, demangle_integral_value, - demangle_arm_hp_template, recursively_demangle, - standard_symbol_characters, hp_symbol_characters, main): Add prototype. - (program_name, program_version, fatal): Constify a char*. - (usage, fatal): Mark with ATTRIBUTE_NORETURN. - (main): Call return, not exit. - -1999-09-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * choose-temp.c: Remove obsolete comment about gcc. - (make_temp_file): Constify a char*. - -Wed Sep 8 20:03:28 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * xmemdup.c: Include sys/types.h. - -1999-09-07 Jeff Garzik <jgarzik@pobox.com> - - * xmemdup.c: New xmemdup function. - * Makefile.in, makefile.vms, vmsbuild.com: Use xmemdup.[co]. - -Tue Sep 7 23:32:18 1999 Linas Vepstas <linas@linas.org> - - * config.table: Add openedition target. - * config/mh-openedition: New file. - -Thu Sep 2 01:36:12 1999 Marc Espie <espie@cvs.openbsd.org> - - * pexecute.c (pexecute): Fill in temp_base when needed. - -1999-08-31 Richard Henderson <rth@cygnus.com> - - * getpwd.c: Check HAVE_GETCWD before defining it away. - -1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * Makefile.in (CFILES): Add calloc.c and getpwd.c. - (REQUIRED_OFILES): Add getpwd.o. - (getpwd.o): Add target. - - * configure.in (AC_PREREQ): Bump to 2.13. - (AC_CHECK_HEADERS): Add check for <sys/stat.h>. - - * getpwd.c: New file, moved here from gcc. - -1999-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * cplus-dem.c (gnu_special): Cast a `size_t' to `long' when - comparing against a signed quantity. - (arm_special): Likewise. - (demangle_fund_type): Likewise. - (do_hpacc_template_const_value): Mark parameter `work' with - ATTRIBUTE_UNUSED. - (main): Constify variable `valid_symbols'. - -Tue Aug 24 02:50:45 1999 Philippe De Muyter <phdm@macqel.be> - - * strtoul.c (strtoul): Add parentheses around && within ||. - -Fri Aug 6 23:32:29 1999 Daniel Jacobowitz <drow@drow.them.org> - - * Makefile.in (FLAGS_TO_PASS): Include prefix, exec_prefix, - libdir, libsubdir and tooldir. - -1999-08-01 Mark Mitchell <mark@codesourcery.com> - - * splay-tree.c (splay_tree_insert): Return the new node. - -1999-07-14 Richard Henderson <rth@cygnus.com> - - * argv.c: Include stdlib.h and string.h instead of - prototyping directly. - * choose-temp.c: Conditionally include string.h. - -1999-07-12 Jason Merrill <jason@yorick.cygnus.com> - - * Makefile.in (NEEDED): Add bcmp, bcopy, bzero. - -1999-07-11 Ian Lance Taylor <ian@zembu.com> - - * splay-tree.c (splay_tree_insert): Add initialization to avoid - warning. - -1999-07-07 Jason Merrill <jason@yorick.cygnus.com> - - * Makefile.in (needed-list): Only include stuff we actually need - for libstdc++. - -1999-06-21 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - - * configure.in (checkfuncs): Add gettimeofday. - * config.in, configure: Regenerated. - -Mon Jun 21 05:56:01 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * configure.in (*-*-uwin*): UWIN has sys_{errlist,nerr} even if - the test fails. - * configure: Regenerate. - -1999-06-10 Mike Stump <mrs@wrs.com> - - * Makefile.in (setenv.o): Add config.h dep for setenv.o to fix - parallel builds. - -1999-05-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * putenv.c: Include ansidecl.h to define `const'. - * setenv.c: Likewise. - -Wed May 26 03:58:20 1999 "Melissa O'Neill" <oneill@cs.sfu.ca> - - * Makefile.in (CFILES): Add putenv.c and setenv.c. - * configure.in (funcs): Add putenv and setenv. - (AC_CHECK_FUNCS): Check for putenv and setenv. - * configure: Rebuilt. - * putenv.c setenv.c: New files. - - * getcwd.c (getcwd): If pathname is NULL, then obtain SIZE - bytes of space using malloc. - -Mon May 17 01:42:34 1999 Stu Grossman <grossman@babylon-5.cygnus.com> - - * cplus-dem.c (demangle_fund_type (near 'I' case)): Don't advance - the *mangled pointer beyond the end of the string. Clean up code to - match prevailing coding style. - -1999-05-13 Michael Hayes <m.hayes@elec.canterbury.ac.nz> - - * tmpnam.c (L_tmpnam): Fix typo. - -Thu May 13 01:14:46 1999 Marc Espie <espie@cvs.openbsd.org> - - * cplus-dem.c (standard_symbol_characters): Renamed from - standard_symbol_alphabet. No longer modify TABLE. - (hp_symbol_characters): Renamed from hp_symbol_alphabet. No longer - modify TABLE. - (main): Corresponding changes. Use strchr to determine if a - character is valid. - -1999-05-11 Jim Blandy <jimb@zwingli.cygnus.com> - - * cplus-dem.c (main): Use table lookup to distinguish identifier - characters from non-identifier characters. - (standard_symbol_alphabet, hp_symbol_alphabet): New functions. - -Thu May 6 20:34:42 1999 Fred Fish <fnf@be.com> - - * configure.in (sys/resource.h): Add to AC_CHECK_HEADERS list. - * getruntime.c: Only attempt to include sys/resource.h and - use getrusage if both HAVE_GETRUSAGE and HAVE_SYS_RESOURCE_H - are defined. - -Mon Apr 26 01:36:06 1999 Donn Terry (donn@interix.com) - - * configure.in (alloca detection): Handle alloca directly for interix. - * configure: Rebuilt. - -Sun Apr 25 01:18:21 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * choose-temp.c (DIR_SEPARATOR): Use '\\' only for native windows32. - -1999-04-20 Jim Blandy <jimb@zwingli.cygnus.com> - - Fix from Dale Hawkins: - * cplus-dem.c (mop_up): Set typevec_size to zero, so it'll be - reallocated properly if we use it again. - - * cplus-dem.c (demangle_fund_type): Check for buffer overrun. Be - stricter about syntax. Always null-terminate string. - -Thu Apr 15 23:00:55 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * configure.in (checkfuncs): Check for sbrk. - * config.in: Rebuilt. - * configure: Likewise. - * xmalloc.c: Use HAVE_SBRK instead of the host specific definitions. - -1999-04-12 Jim Blandy <jimb@zwingli.cygnus.com> - - Fix from Marcus Daniels: - * cplus-dem.c (demangle_fund_type): Don't run off the end of the - identifier looking for another underscore. - -Sun Apr 11 23:20:59 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * pexecute.c: Change all references to __UWIN__ to _UWIN. - * xmalloc.c: Likewise. - (xcalloc): UWIN has sbrk. - (xrealloc): Fix guard macro. - -1999-04-11 Richard Henderson <rth@cygnus.com> - - * alloca-conf.h (alloca) [C_ALLOCA]: Don't use Gcc builtin - or <alloca.h>. - * clock.c (GNU_HZ): New definition. - (clock): Use it. - * getruntime.c: Likewise. - - * config.table: Use mh-beos. - * config/mh-beos: New file. - -1999-04-11 Mark Mitchell <mark@codesourcery.com> - - * cplus-dem.c (demangle_template_value_parm): Handle - pointers-to-members. - (do_type): Handle template parameters as qualifiers. - -1999-04-01 Jim Blandy <jimb@zwingli.cygnus.com> - - * cplus-dem.c: Attempt to handle overflows in counts with some - semblance of grace. - (consume_count): Detect overflows. Return -1 to indicate errors, - instead of zero. - (demangle_template_value_parm, demangle_template): Handle change - to consume_count's return convention. - -1999-04-05 Tom Tromey <tromey@cygnus.com> - - * testsuite/regress-demangle: New file. - * testsuite/demangle-expected: New file. - - * Makefile.in (all, check, installcheck, info, install-info, - clean-info, dvi, install, etags, tags, mostlyclean, clean, - distclean, maintainer-clean, realclean): Depend on corresponding - `-subdir' target. - (all-subdir check-subdir installcheck-subdir info-subdir - install-info-subdir clean-info-subdir dvi-subdir - install-info-subdir etags-subdir mostlyclean-subdir clean-subdir - distclean-subdir maintainer-clean-subdir): New target. - * testsuite/Makefile.in: New file. - * configure: Rebuilt. - * configure.in: Create testsuite/Makefile. - -1999-04-02 Mark Mitchell <mark@codesourcery.com> - - * splay-tree.h (splay_tree_compare_pointers): Define. - -1999-03-30 Mark Mitchell <mark@codesourcery.com> - - * splay-tree.c (splay_tree_compare_ints): Define. - -1999-03-30 Tom Tromey <tromey@cygnus.com> - - * cplus-dem.c (consume_count): If `count' wraps, return 0 and - don't advance input pointer. - (demangle_class_name): If consume_count didn't find a count, do - nothing. Don't bother with `strlen' sanity check; consume_count - does it for us. - -1999-03-16 Stan Shebs <shebs@andros.cygnus.com> - - From Art Haas <ahaas@neosoft.com>: - * cplus-dem.c (demangle_prefix): Don't grab all the '__' strings - when doing arm or hp style. - (demangle_nested_args): Decr forgetting_types field when done. - -Thu Mar 11 01:22:58 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * pexecute.c (__CYGWIN32__): Rename to - (__CYGWIN__): this. - * xmalloc.c: Likewise. - - Changes to support i386-pc-uwin. - * configure.in (*-*-uwin*): Workaround for vfork bug. - * configure: Regenerate. - * pexecute.c (pexecute): Be like standard Unix. - (pwait): Likewise. - * xmalloc.c (first_break): Define. - (xmalloc_set_program_name): Use. - (xmalloc): Use. - -Thu Mar 11 01:07:55 1999 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> - - * config.table: Cleanup and add mh-*pic handling for alpha, arm, powerpc - -Sun Feb 28 22:30:44 1999 Geoffrey Noer <noer@cygnus.com> - - * config.table: Check cygwin*, not cygwin32*. - -Tue Feb 9 16:39:01 1999 Dave Brolley <brolley@cygnus.com> - - * Makefile.in: Change mkstemp -> mkstemps. - -Tue Feb 9 01:12:27 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr> - - * Makefile.in (REQUIRED_OFILES): remove mkstemp.o - * configure.in (funcs): Check for and conditionally add mkstemps to - the list of functions libiberty will provide. - * configure: Rebuilt. - -Wed Feb 3 00:01:15 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * clock.c (HZ): Define in terms of (ISO C) CLOCKS_PER_SEC on - platforms that don't have HZ. - * getruntime.c (HZ): Likewise. - -Sat Jan 30 13:28:04 1999 Richard Henderson <rth@cygnus.com> - - * Makefile.in (xstrdup.o): Depend on config.h. - -Wed Jan 13 07:26:44 1999 H.J. Lu (hjl@gnu.org) - - * cplus-dem.c (mop_up): Set work->previous_argument to NULL after - freeing it. - -Wed Jan 13 14:16:36 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * xstrdup.c (xstrdup): Switch from strcpy to memcpy for speed. - -Tue Jan 5 15:58:29 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - - * Makefile.in (CFILES): fix typo, splay-tree.c instead of - splay-tree.o. - -1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com) - - * configure.in: Require autoconf 2.12.1 or higher. - -1998-12-30 Michael Meissner <meissner@cygnus.com> - - * random.c (NULL): Don't redefine NULL if it is already defined. - -Tue Dec 22 09:43:35 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * argv.c (buildargv): Cast the result of alloca in assignment. - - * choose-temp.c: Include stdlib.h. - - * cplus-dem.c (demangle_arm_pt): Remove unused prototype. - (snarf_numeric_literal): Constify first parameter. - (code_for_qualifier): Avoid a gcc extension, make the parameter an - int, not a char. - (demangle_qualifier): Likewise. - (demangle_signature): Cast the argument of a ctype function to - unsigned char. - (arm_pt): Add parens around assignment used as truth value. - (demangle_arm_hp_template): Constify variable `args'. - (do_hpacc_template_const_value): Cast the argument of a ctype - function to unsigned char. - (do_hpacc_template_literal): Remove unused variable `i'. - (snarf_numeric_literal): Constify parameter `args'. - Cast the argument of a ctype function to unsigned char. - - * floatformat.c (floatformat_to_double): Add explicit braces to - avoid ambiguous `else'. - - * fnmatch.c (fnmatch): Change type of variables `c', `c1', - `cstart' and `cend' to unsigned char. Cast the argument of macro - `FOLD', which uses ctype functions, to unsigned char. - - * objalloc.c (free): Add prototype. - -Sun Dec 20 16:03:46 1998 Hans-Peter Nilsson <hp@axis.se> - - * Makefile.in (CFILES): Fix typo: splay-tree.c, not splay-tree.o - -Fri Dec 18 17:50:18 1998 David Taylor <taylor@texas.cygnus.com> - - * cplus-dem.c (demangle_arm_pt): remove declaration -- function - doesn't exist. - (do_hpacc_template_literal): remove unused variable `i'. - -Fri Dec 18 16:11:43 EST 1998 Andrew MacLeod <amacleod@cygnus.com> - - * cplus-dem.c (demangle_fund_type): Process CV and u codes before - bumping the pointer we read from. Also prepend these codes, - as we do in other places. - -1998-12-18 Nick Clifton <nickc@cygnus.com> - - * cplus-dem.c (demangle_arm_hp_template): Make variable 'args' be - 'const char *' in order to match its usage when calling siblings. - (snarf_numeric_literal): Make first arg 'const char **' in order - to match usage. - -Mon Dec 14 09:55:50 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * choose-temp.c: Don't check IN_GCC anymore. - - * floatformat.c (floatformat_from_double): Use `const', not `CONST'. - * memchr.c (memchr): Likewise. - * memcpy.c (memcpy): Likewise. - * memmove.c (memmove): Likewise. - - * mkstemp.c: Don't check IN_GCC anymore. - * pexecute.c: Likewise. - * splay-tree.c: Likewise. - - * strchr.c (strchr): Use `const', not `CONST'. - * strrchr.c (strrchr): Likewise. - * strtol.c (strtol): Likewise. - * strtoul.c (strtoul): Likewise. - -Fri Dec 4 13:51:04 1998 David Taylor <taylor@texas.cygnus.com> - Elena Zannoni <ezannoni@cygnus.com> - Stan Shebs <shebs@cygnus.com> - Edith Epstein <eepstein@cygnus.com> - Andres MacLeod <amacleod@cygnus.com> - Satish Pai <pai@apollo.hp.com> - - * HP aCC demangling support. - * cplus-dem.c - (main): Remove default to HP style demangling, set to EDG - demangling correctly when -edg specified; set the demangling style - when user specifies 'edg'. Set strip_underscore to - prepends_underscore, if not HPUXHPPA. Set - current_demangling_style to hp_demangling if HPUXHPPA. Set - current demangling style correctly if the switch is hp. Read - label correctly also in the HP style case. - (work_stuff): add temp_start field; add field for volatile member - function. - (arm_pt): handle ARM_DEMANGLING and EDG_DEMANGLING styles; HP - style for this case is the same as ARM. - (demangle_args): handle EDG_DEMANGLING style; support HP style. - (demangle_arm_hp_template): new function. (It was - demangle_arm_pt.); check and set value of temp_start field in - multiple places. Also, when ceching for end of template args, - check to see if at end of static member of template class. - (demangle_class): new local variable : save_class_name_end Don't - include template args in string defining class. - (demangle_class_name): use demangel_arm_hp_template. - (demangle_function_name): handle case where demangling style is - HP_DEMANGLING and currently point at an 'X' in the mangled name. - Handle EDG_DEMANGLING style. Handle constructor and destructor - ops for HP style. - (demangle_prefix): handle EDG_DEMANGLING and ARM_DEMANGLING - styles. global destructor and constructor for HP style are same - as for ARM style. Same for local variables. - (demangle_qualified): handle EDG_DEMANGLING style. - (demangle_signature): add case for volatile member function. For - cases '1' - '9' : initialize the temp_start field to -1 and handle - the EDG_DEMANGLING style. for case 'F' : handle EDG_DEMANGLING - and AUTO_DEMANGLING styles. If expecting a function and managed - to demangle the funct args, then handle the LUCID_DEMANGLING, - ARM_DEMANGLING, and EDG_DEMANGLING styles. Add case for local - class name after "Lnnn_ in HP style case. HP style too needs to - forget types. _nnn is OK for HP style, so don't report failure. - (do_hpacc_template_const_value): new function. Handle template's - value param for HP/aCC. - (do_hpacc_template_literal): new function. Handle a template's - literal parameter for HP aCC. - (recursively_demangle): new function - (snarf_numeric_literal): new function. - (usage): add 'edg' to the list of demangling styles; add hp switch - to message. - -Sat Nov 28 17:25:22 1998 Christopher Faylor <cgf@cygnus.com> - - * pexecute.c: Remove obsolete ifdefed cygwin code. - -Fri Nov 27 13:26:06 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * choose-temp.c: Always include libiberty.h. Avoid redundancies. - * cplus-dem.c: Likewise. Conform to libiberty.h. - * pexecute.c: Likewise. - * splay-tree.c: Likewise. - -1998-11-25 Mike Stump <mrs@wrs.com> - - * Makefile.in (splay-tree.o): Add config.h dependency. - -Mon Nov 23 16:59:49 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * configure.in: Use AC_PREREQ(2.12.1). - -1998-11-16 Benjamin Kosnik <bkoz@haight.constant.com> - - * cplus-dem.c (demangle_fund_type): Add demangling for C9x types. - -Thu Nov 19 22:15:50 1998 Jeffrey A Law (law@cygnus.com) - - * mpw.c (mpw_access): Add missing parens. - -Thu Nov 19 12:59:21 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * configure.in: Call AC_HEADER_SYS_WAIT. - - * pexecute.c: Include sys/wait.h when !IN_GCC. - -Thu Nov 19 14:38:20 1998 Geoffrey Noer <noer@cygnus.com> - - * pexecute.c: revert back to checking old Cygwin - preprocessor symbol until some time has passed. - -Wed Nov 18 08:52:26 1998 Christopher Faylor <cgf@cygnus.com> - - * pexecute.c: Reorganize WIN32 case to accomodate Cygwin - since it will now support similar constructs. - -Fri Nov 13 19:18:05 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * configure.in: Check for calloc. - - * calloc.c: New file. - - * xmalloc.c (xcalloc): New function. - -Fri Nov 13 08:51:46 EST 1998 Andrew MacLeod <amacleod@cygnus.com> - - *cplus-dem.c (demangle_prefix): Use the last "__" - in the mangled name when looking for the signature. This allows - template names to begin with "__". - -1998-11-08 Mark Mitchell <mark@markmitchell.com> - - * cplus-dem.c (type_kind_t): Add tk_reference. - (demangle_template_value_parm): Handle it. - (do_type): Use it for references, instead of tk_pointer. - - * cplus-dem.c (demangle_template_value_parm): Use cplus_demangle, - not internal_cplus_demangle. - -Sat Nov 7 16:02:10 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * choose-temp.c: Don't include gansidecl.h. - * mkstemp.c: Likewise. - * pexecute.c: Likewise. - -Mon Nov 2 15:05:33 1998 Geoffrey Noer <noer@cygnus.com> - - * configure.in: detect cygwin* instead of cygwin32* - * configure: regenerate - -Mon Nov 2 10:22:01 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * pexecute.c: Check HAVE_CONFIG_H, not IN_GCC, when determining - whether to include config.h. Possibly include unistd.h in the - !IN_GCC case. Define VFORK_STRING as a printable function call - for error messages (either "vfork" or "fork".) If HAVE_VFORK_H is - defined, include vfork.h. If VMS is defined, define vfork() - appropriately. Remove vfork check on USG, we're using autoconf. - (pexecute): Set `errmsg_fmt' to VFORK_STRING instead of checking - locally what string to use. - -1998-10-26 Mark Mitchell <mark@markmitchell.com> - - * splay-tree.c: Tweak include directives to make sure declarations of - xmalloc and free are available. - -1998-10-25 Mark Mitchell <mark@markmitchell.com> - - * cplus-dem.c (gnu_special): Fix handling of virtual tables in - anonymous namespaces. - -1998-10-23 Mark Mitchell <mark@markmitchell.com> - - * cplus-dem.c (work_stuff): Replace const_type and volatile_type - with type_quals. - (TYPE_UNQUALIFIED): New macro. - (TYPE_QUAL_CONST): Likewise. - (TYPE_QUAL_VOLATILE): Likewise. - (TYPE_QUAL_RESTRICT): Likewise. - (code_for_qualifier): New function. - (qualifier_string): Likewise. - (demangle_qualifier): Likewise. - (internal_cplus_demangle): Use them. - (demangle_signature): Likewise. - (demangle_template_value_parm): Likewise. - (do_type): Likewise. - (demangle_fund_type)): Likewise. - -Thu Oct 22 19:58:43 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * splay-tree.c (splay_tree_foreach_helper): Make definition static - to match prototype. - -1998-10-21 Mark Mitchell <mark@markmitchell.com> - - * splay-tree.c: New file. - * Makefile.in (CFILES): Add it. - (REQUIRED_OFILES): Likewise. - (splay-tree.o): Add dependencies. - -Tue Oct 20 12:29:02 1998 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - - * cplus-dem.c (demangle_qualified): Fix off-by-one when checking - range of 'K' index. - -Thu Oct 15 18:51:12 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * choose-temp.c: Prototype mkstemps() when IN_GCC. - - * cplus-dem.c (consume_count): Cast argument of ctype macro to - `unsigned char'. - (cplus_demangle_opname): Cast the result of `strlen' to (int) when - comparing against one. - (cplus_mangle_opname): Likewise. - (demangle_integral_value): Cast argument of ctype macro to - `unsigned char'. - (demangle_template_value_parm): Likewise. - (demangle_template): Initialize variable `bindex'. Cast the - result of `strlen' to (int) when comparing against one. Remove - unused variable `start_of_value_parm'. - (demangle_class_name): Cast the result of `strlen' to (int) when - comparing against one. - (demangle_prefix): Cast argument of ctype macro to `unsigned char'. - (gnu_special): Likewise. Cast the result of `strlen' to (int) - when comparing against one. - (demangle_qualified): Cast argument of ctype macro to `unsigned char'. - (get_count): Likewise. - (do_type): Likewise. Cast the result of `strlen' to (int) when - comparing against one. - (demangle_fund_type): Cast argument of ctype macro to `unsigned char'. - (demangle_function_name): Cast the result of `strlen' to (int) - when comparing against one. - - * mkstemp.c (mkstemps): Cast variable `len' to (int) when - comparing against one. - -Tue Oct 13 23:51:51 1998 Jeffrey A Law (law@cygnus.com) - - * mkstemp.c: Check HAVE_SYS_TIME_H before including sys/time.h - * configure.in (AC_CHECK_HEADERS): Check for sys/time.h too. - * config.in, configure: Rebuilt. - - * getopt.c: Check HAVE_STRINGS_H before including strings.h. - * configure.in (AC_CHECK_HEADERS): Check for strings.h too. - * config.in, configure: Rebuilt. - -Mon Oct 12 19:15:59 1998 Geoffrey Noer <noer@cygnus.com> - - * configure.in: in comment, call AC_EXEEXT instead of AM_EXEEXT - -Sun Oct 11 17:36:06 1998 Michael Tiemann <tiemann@holodeck.cygnus.com> - - * Makefile.in (cplus-dem.o, obstack.o): Depend upon config.h. - -Thu Oct 8 23:42:08 1998 Jeffrey A Law (law@cygnus.com) - - * Merge egcs & devo libiberty. - -1998-09-08 Martin von Löwis <loewis@informatik.hu-berlin.de> - - * cplus-dem.c (demangle_arm_pt): Demangle anonymous namespaces. - -Mon Sep 7 23:29:01 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * mkstemp.c: Include config.h even when not IN_GCC. Wrap header - inclusions inside HAVE_*_H macros. Include ansidecl.h when not - IN_GCC. - - * vasprintf.c: Include stdarg.h/varargs.h first. - - * vprintf.c: Likewise. - -Sat Sep 5 03:24:49 1998 Jeffrey A Law (law@cygnus.com) - - * pexecute.c: Updates from gcc. Copy in gcc has been removed. This - is the canonical copy. Define ISSPACE if !IN_GCC. - * alloca.c, vfprintf.c, choose-temp.c, mkstemp.c, getopt.c: Similarly. - * getopt1.c, obstack.c: Similarly. - * Makefile.in: Build mkstemp.o - -Tue Sep 1 23:12:47 1998 Christopher Faylor <cgf@cygnus.com> - - * configure.in: Include asprintf in list of functions known not - to be in newlib. - * configure: Rebuild. - -Wed Aug 19 14:05:01 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * cplus-dem.c (work_stuff): Add dllimported. - (demangled_prefix): Mark symbols imported from PE DLL. - (internal_cplus_demangled): Handle. - -1998-08-17 Jason Merrill <jason@yorick.cygnus.com> - - * cplus-dem.c (do_type): Fix simple array handling. If we fail, - stay failed. - -Mon Aug 17 10:40:34 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * cplus-dem.c: Include config.h if it exists. Also, only - prototype malloc/realloc if we can't get stdlib.h. - -Sat Aug 15 16:15:01 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Switch back to checking --with-target-subdir when - deciding whether to check for newlib, undoing part of July 15 - change. - * configure: Rebuild. - -Thu Aug 13 16:47:38 1998 Mark Mitchell <mark@markmitchell.com> - - * cplus-dem.c (type_kind_t): New type. - (demangle_template_value_parm): Add type_kind_t parameter. Rely - on this paramter, rather than demangling the type again. - (demangle_integral_value): Pass tk_integral. - (demangle_template_: Pass the value returned from do_type. - (do_type): Return a type_kind_t. Pass tk_integral to - demangle_template_value_parm for array bounds. - (demangle_fund_type): Likewise. - - Also incorporate from GCC version: - - Tue Jul 21 13:28:19 1998 Jason Merrill <jason@yorick.cygnus.com> - - * cplus-dem.c (do_type): Use demangle_template_value_parm for arrays. - -Thu Aug 13 16:47:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * cplus-dem.c (demangle_nested_args): Make function definition - static to match the prototype. - -Tue Jul 28 11:33:09 1998 Mark Mitchell <mark@markmitchell.com> - - * cplus-dem.c (type_kind_t): New type. - (demangle_template_value_parm): Add type_kind_t parameter. Rely - on this paramter, rather than demangling the type again. - (demangle_integral_value): Pass tk_integral. - (demangle_template_: Pass the value returned from do_type. - (do_type): Return a type_kind_t. Pass tk_integral to - demangle_template_value_parm for array bounds. - (demangle_fund_type): Likewise. - - Also incorporate from GCC version: - - Tue Jul 21 13:28:19 1998 Jason Merrill <jason@yorick.cygnus.com> - - * cplus-dem.c (do_type): Use demangle_template_value_parm for arrays. - -Mon Jul 27 12:16:08 1998 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (ALLOCA): New variable. - ($(TARGETLIB)): Add $(ALLOCA) to library. - (needed-list): Add $(ALLOCA). - ($(ALLOCA)): Depend upon stamp-picdir. - -Sun Jul 19 08:23:17 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * cplus-dem.c (demangle_nested_args): Make function definition - static to match the prototype. - -Wed Jul 15 00:12:58 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Check --with-cross-host rather than - --with-target-subdir when deciding whether build uses a cross - compiler, and when deciding where to install the library. - * configure: Rebuild. - -Sun Jul 12 01:27:05 1998 Jason Merrill <jason@yorick.cygnus.com> - - * cplus-dem.c (demangle_nested_args): Return a value. - -Sat Jul 11 16:19:48 1998 Mark Mitchell <mark@markmitchell.com> - - * cplus-dem.c (string): Move definition before work_stuff. - (work_stuff): Add volatile_type, forgetting_types, - previous_argument, and nrepeats fields. - (SCOPE_STRING): New macro. - (demangle_template): Add `remember' parameter. Add comment. - Register the `B' code type here, if remembering. Tidy. Fix crash - on NULL tmpl_argvec. Be consistent with use of tname/trawname. - (demangle_nested_args): New function. - (internal_cplus_demangle): Handle volatile-qualified member - functions. - (mop_up): Delete the previous_argument string if present. - (demangle_signature): Tidy. Handle volatile-qualified member - functions. Handle back-references using the `B' code. Use extra - parameter to demangle_template and SCOPE_STRING where appropriate. - (demangle_template_value_parm): Fix thinko; 'B' is not an integral - code. - (demangle_class): Use SCOPE_STRING. - (gnu_special): Pass additional argument to demangle_template. - Use SCOPE_STRING. - (demangle_qualified): Save qualified types for later - back-references. Handle constructors and destructors for template - types correctly. - (do_type): Tidy. Use SCOPE_STRING. Pass extra argument to - demangle_template. Use demangled_nested_args. Don't remember - qualified types here; that's now done in demangle_qualified. - Similarly for templates. - (do_arg): Improve commment. Handle 'n' repeat code. - (remember_type): Check forgetting_types. - (demangle_args): Deal with 'n' repeat codes. Tidy. - -Thu Jul 2 16:26:24 1998 Ian Lance Taylor <ian@cygnus.com> - - * config.table: Only use mh-fbsd21 on *-*-freebsd2.2.[012], not on - *-*-freebsd2.2.*. From Dmitrij Tejblum <tejblum@arc.hq.cti.ru>. - -Mon Jun 15 16:29:01 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in (setobjs): Correct quoting error in cygwin32 case. - From Chris Faylor <cgf@cygnus.com>. - -Mon Jun 1 13:47:55 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * obstack.c: Update to latest FSF version. - -Mon Jun 1 14:17:36 1998 Mike Stump <mrs@wrs.com> - - * Makefile.in: Add a dependency on stamp-picdir for the - objects, so that we can do a parallel build. - -Sat May 30 22:17:13 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * configure.in (checkfuncs): Add missing "'". - -Fri May 29 12:40:41 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * obstack.c (_obstack_memory_used): Elide this function if we're - on a system with GNU libc. - -Tue May 26 18:28:43 1998 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (distclean): Remove config.log. - -Tue May 26 15:01:52 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * Makefile.in (distclean): Don't remove alloca-conf.h. - -Fri May 22 01:38:07 1998 Hans-Peter Nilsson <hp@axis.se> - - * cplus-dem.c (MBUF_SIZE): Bumped from 512 to 32767. - -1998-05-21 Mark Mitchell <mmitchell@usa.net> - - * cplus-dem.c (do_type): Handle volatile qualification. - -1998-05-21 Manfred Hollstein <manfred@s-direktnet.de> - - * configure.in: Check for unistd.h as well. - * configure: Rebuild. - * config.in: Rebuild. - * getpagesize.c (GNU_OUR_PAGESIZE): Use sysconf only if _SC_PAGESIZE - is defined in unistd.h. Reformat conditional block for easier reading. - - * config.table (shared): Default to no if ${enable_shared} - is unset or empty; this logic is used by the toplevel - configure scripts, too. - -Sat May 16 14:01:26 1998 Jeffrey A Law (law@cygnus.com) - - * config.table: Add line to set enable_shared in the Makefile - as needed. - -Wed May 13 14:24:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * cplus-dem.c (squangle_mop_up): Change return type to void. - (internal_cplus_demangle): Remove unused parameter `options'. - All callers changed. - (cplus_demangle_opname): Remove function wide variable `int i' and - replace with `size_t i' at each location where it is used. - (cplus_mangle_opname): change type of `i' from int to size_t. - -Wed May 13 13:39:38 1998 Ian Lance Taylor <ian@cygnus.com> - - * alloca-conf.h: Include config.h. Check HAVE_ALLOCA_H rather - than sparc or sun. - * Makefile.in (argv.o): Depend upon config.h and alloca-conf.h. - -Fri May 8 00:23:51 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Set libiberty_topdir correctly when srcdir is - "." and with_target_subdir is not set. - * configure: Rebuild. - -Thu May 7 13:01:44 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Add *-*-mingw32* case. - * configure: Rebuild. - -Wed May 6 11:33:51 1998 Ian Lance Taylor <ian@cygnus.com> - - * config.table: Never use a PIC file for *-*-cygwin32*. - - * Makefile.in (config.status): Depend upon config.table. - - * configure.in: On a cygwin32 host, always compile random, and - don't test for sys_siglist, strsignal, or psignal. - * configure: Rebuild. - - * clock.c: Check HAVE_SYS_PARAM_H rather than NO_SYS_PARAM_H. - * getcwd.c: Likewise. - * getpagesize.c: Likewise. - * getruntime.c: Likewise. - -Tue May 5 18:08:32 1998 Ian Lance Taylor <ian@cygnus.com> - - Use autoconf tests rather than the old dummy.c test: - * configure.in: Add AC_ARG_WITH calls for --with-target-subdir and - --with-newlib. Add AC_CONFIG_HEADER. Use AC_REPLACE_FUNCS for - most functions. Add special cases to handle newlib and VxWorks. - Remove target_makefile_frag. Create stamp-h in AC_OUTPUT if - CONFIG_HEADERS is set. Only call config-ml.in in AC_OUTPUT if - CONFIG_FILES is set; set ac_file before calling it. - * config.table (arm-*-riscix*, *-*-cygwin32): Remove. - (*-*-hpux*, *-*-hiux*, *-*-irix4*, *-*-solaris2*): Remove. - (*-*-sysv4*, *-*-go32, *-*-vxworks5*, *-*-vxworks): Remove - (i[3456]-*-mingw32*): Remove. - * Makefile.in (ERRORS_CC, CONFIG_H, NEEDED_LIST): Remove. - (LIBOBJS): New variable. - (HOST_OFILES, DO_ALSO, STAGESTUFF): Remove. - (all): Depend upon needed-list. Don't check RULE1. - (@target_makefile_frag@): Remove. - (COMPILE.c): Include @DEFS@. - (HFILES): Add alloca-conf.h. - (REQUIRED_OFILES): Remove basename.o. - ($(TARGETLIB)): New target. - (stamp-needed, lneeded-list, needed.awk, stamp-config): Remove. - (lconfig.h, needed2.awk, dummy.o, errors): Remove. - (needed-list, config.h): Rewrite. - (RULE1, $(RULE1), RULE2, $(RULE2)): Remove. - (.always.): Remove. - (Makefile): Set CONFIG_FILES and CONFIG_HEADERS. - (stamp-h): New target. - (atexit.o, clock.o, getcwd.o, getpagesize.o): New targets. - (basename.o): Don't depend upon config.h. - (getruntime.o): Depend upon config.h. - * atexit.c: Include config.h. Check HAVE_ON_EXIT rather than - NEED_on_exit. - * basename.c: Don't include config.h. Don't check NEED_basename. - * clock.c: Include config.h. - * getcwd.c: Likewise. - * getpagesize.c: Likewise. - * getruntime.c: Likewise. Fix checks which set HAVE_GETRUSAGE and - HAVE_TIMES. - * strerror.c: Change uses of NEED_sys_errlist to - HAVE_SYS_ERRLIST. Likewise for NEED_strerror and HAVE_STRERROR. - * strsignal.c: Likewise for NEED_sys_siglist and HAVE_SYS_SIGLIST, - and for NEED_strsignal and HAVE_STRSIGNAL and for NEED_psignal and - HAVE_PSIGNAL. - * acconfig.h: New file. - * dummy.c: Remove. - * functions.def: Remove. - * config/mh-cxux7 (HDEFINES): Remove -DHAVE_SYSCONF. - * config/mh-windows (HDEFINES): Remove. - * config/mh-cygwin32: Remove. - * config/mh-go32: Remove. - * config/mh-irix4: Remove. - * config/mh-riscix: Remove. - * config/mh-sysv4: Remove. - * config/mt-mingw32: Remove. - * config/mt-vxworks5: Remove. - * config.in: New file, generated using autoheader. - * configure: Rebuild. - -Mon May 4 13:00:28 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Rewrite to use autoconf. - * configure: Generate using autoconf. - * config/mh-a68bsd: Remove. - * config/mh-apollo68: Remove. - * config/mh-hpbsd: Remove. - * config/mh-ncr3000: Remove. - * config/mh-sysv: Remove. - * config/mh-aix (RANLIB, INSTALL): Don't define. - * config/mh-cxux7 (RANLIB, INSTALL): Don't define. - * config/mh-irix4 (CC, RANLIB, INSTALL): Don't define. - * config/mh-sysv4 (RANLIB, INSTALL): Don't define. - * config.table: Change config_shell to CONFIG_SHELL, and use - libiberty_topdir to find move-if-change. - (m68k-apollo-bsd*, m68k-apollo-sysv*): Remove. - (i[3456]86-ncr-sysv4*, *-*-dgux*, hppa*-hp-bsd*): Remove. - (*-*-irix*, *-*-m88kbcs*, *-*-sysv*): Remove. - * Makefile.in (srcdir): Set to @srcdir@. - (VPATH): Likewise. - (prefix, exec_prefix, bindir, libdir): Set to autoconf variables. - (SHELL, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Likewise. - (CC, CFLAGS, RANLIB)): Likewise. - (datadir, man*dir, infodir, includedir, MAKEINFO): Remove. - (target_makefile_frag, host_makefile_frag): Add substitutions. - (INSTALL_DEST): Set to @INSTALL_DEST@. - (Makefile): Depend upon config.status. Don't depend upon - $(host_makefile_frag) or $(target_makefile_frag). - (config.status): New target. - -Sun May 3 17:58:49 1998 Ian Lance Taylor <ian@cygnus.com> - - * config/mt-sunos4: Remove. Should be handled by --with-headers - and --with-libraries options at top level. - * config.table: Never use mt-sunos4. - - * alloca-conf.h: New file, combining alloca-norm.h and - alloca-botch.h. - * alloca-norm.h: Remove. - * alloca-botch.h: Remove. - * configure.in: Set shell variables files and links to empty. - * config.table: Don't set shell variable files. - * configure.bat: Don't create alloca-conf.h. - * makefile.vms: Likewise. - * mpw-config.in: Likewise. - * vmsbuild.com: Likewise. - -Fri May 1 11:41:42 1998 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in ($(HOST_OFILES) $(REQUIRED_OFILES)): Remove old - target depending upon config.h. - (alloca.o): Add target depending upon config.h - (basename.o, choose-temp.o, fnmatch.o): Likewise. - (getopt.o, getopt1.o, pexecute.o, strerror.o): Likewise. - (strsignal.o, xstrerror.o): Likewise. - -Fri May 1 04:26:25 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de> - - * cplus-dem.c (cplus_demangle_opname): Initialize work. - -Mon Apr 27 15:53:30 EDT 1998 Andrew MacLeod <amacleod@cygnus.com> - - * cplus-dem.c (demangle_qualified): Replace missing else. - -Sun Apr 26 15:38:50 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - - * cplus-dem.c (gnu_special): Fix off-by-one bug when checking the - length in the name of a virtual table. - -Wed Apr 22 10:53:49 EDT 1998 Andrew MacLeod <amacleod@cygnus.com> - - * cplus-dem.c (struct work stuff): Add field for B and K mangle codes. - (cplus_demangle_opname): Call mop_up_squangle. - (cplus_demangle): Initialize squangle info, then call - internal_cplus_demangle. (Most code moved there as well) - (internal_cplus_demangle): New function, performs most of what use - to be done in cplus_demangle, but is only called with this file. - (squangle_mop_up): New function to clean up B and K code data. - (mop_up): set pointers to NULL after freeing. - (demangle_signature, demangle_template, demangle_class): Add - switch elements to handle K and B codes. - (demangle_prefix, gnu_special, demangle_qualified): Add - code to handle K and B codes. - (do_type, demangle_fund_type): Handle B and K codes. - (remember_Ktype): New function to store K info. - (register_Btype, remember_Btype): New functions for B codes. - (forget_B_and_K_types): New function to destroy B and K info. - -Fri Apr 10 01:49:10 1998 Jeffrey A Law (law@cygnus.com) - - * COPYING.LIB, choose-temp.c, cplus-dem.c: Sync with egcs & gcc. - -Thu Mar 5 09:23:28 1998 Manfred Hollstein <manfred@s-direktnet.de> - - * config.table: Make locating frag files failsafe even for the - special case if configuring and building in srcdir. - -Mon Feb 23 14:33:15 1998 Ian Lance Taylor <ian@cygnus.com> - - * choose-temp.c: Fix handling of sys/file.h to work in libiberty. - -Sun Feb 22 18:03:23 1998 Jeffrey A Law (law@cygnus.com) - - * choose-temp.c: Sync with copy in gcc. - -Thu Feb 12 16:29:49 1998 Ian Lance Taylor <ian@cygnus.com> - - * getopt.c: Update to latest FSF version. - * getopt1.c: Likewise. - -Tue Feb 10 16:58:33 1998 Stan Shebs <shebs@andros.cygnus.com> - - * cplus-dem.c (gnu_special): Don't get confused by .<digits> - strings that are not actually lengths. - -Fri Feb 6 01:35:17 1998 Manfred Hollstein <manfred@s-direktnet.de> - - * Makefile.in (FLAGS_TO_PASS): Don't pass PICFLAG. - (.c.o): Check value of enable_shared, not PICFLAG. - (stamp-picdir): Dito. - -Thu Feb 5 18:48:56 1998 Geoffrey Noer <noer@cygnus.com> - - * config/mh-cygwin32: remove vasprintf.o from EXTRA_OFILES - since it gets built automatically - -Sun Feb 1 02:52:32 1998 Mike Stump <mrs@wrs.com> - - * config.table (vxworks configs): Default to VxWorks 5.x, as that is - the currently shipping OS. - -Tue Jan 27 16:08:20 1998 Pat Rankin <rankin@eql.caltech.edu> - - * vmsbuild.com [REQUIRE_OFILES]: Synchronized with Makefile.in: - Add fnmatch.o and objalloc.o; remove vasprintf.o. - [config.h]: Define NEED_strsignal. - -Mon Jan 19 12:20:01 1998 Ian Lance Taylor <ian@cygnus.com> - - * functions.def: Correct argument types for strerror and - strsignal. Reported by Alex Gutman <agutman@emc.com>. - -Sun Jan 18 15:57:28 1998 Michael Snyder <msnyder@cleaver.cygnus.com> - - * vasprintf.c (int_vasprintf): Increase buffer size for float/double - values. - -Sat Jan 17 22:28:38 1998 Mumit Khan <khan@xraylith.wisc.edu> - J.J. VanderHeijden <J.J.vanderHeijden@student.utwente.nl> - - Add mingw32 support. - * pexecute.c (pexecute): New function for mingw32. Supports pipes. - (pwait): New function for mingw32. - - * config.table (i[3456]86-*-mingw32*): Support for i386-mingw32. - * config/mt-mingw32: New file. - * xmalloc.c (first_break): Not used for mingw32. - (xmalloc_set_program_name): Don't use sbrk on mingw32. - (xmalloc): Likewise. - (xrealloc): Likewise. - -Sat Jan 17 22:28:05 1998 Jeffrey A Law (law@cygnus.com) - - * choose-temp.c: Sync with gcc version. - -Tue Jan 13 18:34:39 1998 Jim Wilson <wilson@cygnus.com> - - * Makefile.in (install_to_libdir, install_to_tooldir): Add MULTISUBDIR - to all filenames in libdir and tooldir. - (distclean): Do MULTICLEAN before deleting Makefile. - (stamp-needed, stamp-config): Add MULTISRCTOP to - pathname for move-if-change. - -Thu Dec 4 17:25:19 1997 Jeffrey A Law (law@cygnus.com) - - * strsignal.c (sys_nsig): Try NSIG and _NSIG. - -Wed Nov 19 13:37:06 1997 Michael Meissner <meissner@cygnus.com> - - * alloca-norm.h (alloca, GCC case): Don't redefine alloca if it - was already defined previously. - -Mon Nov 10 12:48:03 1997 Philippe De Muyter <phdm@macqel.be> - - * Makefile.in (INSTALL): Use ../install-sh, not install. - -Tue Oct 28 23:41:15 1997 Judy Goldberg <jodyg@idt.net> - - * Makefile.in (CFILES): Add pexecute.c. - -Wed Oct 15 19:13:48 1997 Ian Lance Taylor <ian@cygnus.com> - - * asprintf.c: Consistently use either stdarg or varargs. - -Tue Oct 14 12:01:00 1997 Mark Mitchell <mmitchell@usa.net> - - * cplus-dem.c (demangle_signature): Don't look for return types on - constructors. Handle member template constructors. - -Fri Oct 3 17:53:30 1997 Ian Lance Taylor <ian@cygnus.com> - - * README: Fix configuration instructions. - -Mon Sep 29 12:28:41 1997 Ian Lance Taylor <ian@cygnus.com> - - * pexecute.c: Update to current version from /gd/gnu/lib: - - Mon Sep 29 12:27:59 1997 Ian Lance Taylor <ian@cygnus.com> - - * pexecute.c: Use spawn if __CYGWIN32__. - - 1997-08-08 Paul Eggert <eggert@twinsun.com> - - * pexecute.c: Include "config.h" first, as per autoconf manual. - - Fri Jun 27 15:20:29 1997 Scott Christley <scottc@net-community.com> - - * pexecute.c (fix_argv): New function. - (pexecute): Win32 but not Cygwin32 needs its arguments fixed. - Add underscore to cwait function call. - -Sun Sep 28 12:00:52 1997 Mark Mitchell <mmitchell@usa.net> - - * cplus-dem.c (demangle_template): Add new parameter. Handle new - template-function mangling. - (consume_count_with_underscores): New function. - (demangle_signature): Handle new name-mangling scheme. - -Wed Sep 24 00:31:59 1997 Felix Lee <flee@yin.cygnus.com> - - * asprintf.c: stdarg.h when ALMOST_STDC - * config/mh-windows (EXTRA_OFILES): add asprintf.o and - strncasecmp.o. - -Thu Aug 28 14:27:15 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * vasprintf.c (vasprintf): Allow for _BSD_VA_LIST_. - - * config.table: Add case for FreeBSD 2.1 and 2.2, needs mh-fbsd21. - - * config/mh-fbsd21 (EXTRA_OFILES): Force vasprintf.o - -Wed Sep 10 12:43:10 1997 Jason Merrill <jason@yorick.cygnus.com> - - * cplus-dem.c (demangle_fund_type): Change "complex" to "__complex". - -Fri Sep 5 16:34:42 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * asprintf.c (asprintf): New file. - * Makefile.in (CFILES): Add asprintf.c - * functions.def: Ditto. - -Thu Aug 28 18:53:34 1997 Andrew Cagney <cagney@b1.cygnus.com> - - * argv.c (dupargv): New function, duplicate an argument vector. - -Tue Aug 19 20:28:45 1997 Geoffrey Noer <noer@cygnus.com> - - * config/mh-cygwin32: also build random.o - -Tue Aug 19 17:10:56 1997 Jason Merrill <jason@yorick.cygnus.com> - - * cplus-dem.c: Add 'extern' to prepends_underscore. - -Wed Jul 30 11:42:19 1997 Per Bothner <bothner@cygnus.com> - - * cplus-dem.c: Various changes to produce Java output when passed - DMGL_JAVA. Thus "::" becomes "." and "JArray<Foo>" becomes "Foo[]". - (main): Support --java and -j flags to set DMGL_JAVA. - -Tue Jul 22 19:05:23 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE> - - * config/mh-go32 (CC, AR, RANLIB): Don't define. - -Tue Jul 22 17:49:54 1997 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (REQUIRED_OFILES): Add pexecute.o. - (pexecute.o): New target. - - * Makefile.in (stamp-needed): New target, replacing needed-list. - (needed-list): Just depend upon stamp-needed. - (stamp-config): New target, replacing config.h. - (config.h): Just depend upon stamp-config. - (mostlyclean): Remove stamp-*. - -Thu Jun 12 11:00:18 1997 Angela Marie Thomas (angela@cygnus.com) - - * Makefile.in (FLAGS_TO_PASS): pass INSTALL, INSTALL_PROGRAM and - INSTALL_DATA for multilibbed installs - -Tue Jun 3 13:21:05 1997 Doug Evans <dje@canuck.cygnus.com> - - Tue Dec 10 09:44:57 1996 Paul Eggert <eggert@twinsun.com> - - * choose-temp.c (choose_temp_base): Don't dump core if TMPDIR is empty. - - * choose-temp.c (try): Insist that temp dir be searchable. - - Wed Oct 23 17:36:39 1996 Doug Rupp (rupp@gnat.com) - - * choose-temp.c (choose_temp_base): On VMS, use proper syntax - for current directory. - - Sat Feb 15 19:03:48 1997 Geoffrey Noer (noer@cygnus.com) - - * pexecute.c: Remove special cases for cygwin32. - (pwait): Remove local definition of `pid'. - - Tue Nov 12 18:26:15 1996 Doug Rupp (rupp@gnat.com) - - * pexecute.c (vfork): Supply new definition for VMS. - (pwait): Use waitpid instead of wait for VMS. - -Tue May 20 14:02:20 1997 Brendan Kehoe <brendan@lisa.cygnus.com> - - * cplus-dem.c (do_type): Handle `J'. - (demangle_fund_type): Print "complex" for it. - -Wed Apr 30 12:15:45 1997 Jason Merrill <jason@yorick.cygnus.com> - - * configure.in: Don't turn on multilib here. - -Mon Apr 28 19:04:31 1997 Michael Snyder <msnyder@cleaver.cygnus.com> - - * obstack.c: move _obstack_memory_used outside of ifdef. Cannot be - elided; needed by gdb and not present in libc. - -Thu Apr 24 19:33:47 1997 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (clean): Remove tmpmulti.out. - -Tue Apr 22 10:25:15 1997 Fred Fish <fnf@cygnus.com> - - * floatformat.c (floatformat_ieee_double_littlebyte_bigword): - Add new floatformat, mainly for ARM doubles. - -Mon Apr 14 12:11:16 1997 Ian Lance Taylor <ian@cygnus.com> - - * config.table: Use ${config_shell} with ${moveifchange}. From - Thomas Graichen <graichen@rzpd.de>. - -Fri Apr 4 03:09:24 1997 Ulrich Drepper <drepper@cygnus.com> - - * configure.in: Enable multilibing by default. - Update multilib template to read config-ml.in. - -Tue Apr 1 16:26:39 1997 Klaus Kaempf <kkaempf@progis.de> - - * makefile.vms: Add objalloc. - -Mon Mar 31 23:57:51 1997 H.J. Lu <hjl@gnu.ai.mit.edu> - - * cplus-dem.c (demangle_it): Add prototype declaration. - (usage, fatal): Likewise. - - * xexit.c (_xexit_cleanup): Add prototype. - - * strerror.c (init_error_tables): Declare. - -Fri Mar 28 11:43:20 1997 H.J. Lu <hjl@lucon.org> - - * functions.def: Add DEF of vasprintf, and DEFFUNC of strsignal. - * strsignal.c: Only define strsignal if NEED_strsignal. - * Makefile.in (REQUIRED_OFILES): Remove vasprintf.o. - * configure.in: Add NEED_strsignal to xconfig.h. Add vasprintf.o - to xneeded-list. - * config/mh-cygwin32 (HDEFINES): Add -DNEED_strsignal. - (EXTRA_OFILES): Define to vasprintf.o. - * config/mh-windows (HDEFINES): Add -DNEED_strsignal. - (EXTRA_OFILES): Add vasprintf.o. - * config/mt-vxworks5 (vxconfig.h): Define NEED_strsignal. - (vxneeded-list): Add vasprintf.o. - -Thu Mar 20 17:02:09 1997 Ian Lance Taylor <ian@cygnus.com> - - * objalloc.c: Include <stdio.h>. - -Mon Mar 17 19:23:11 1997 Ian Lance Taylor <ian@cygnus.com> - - * objalloc.c: New file. - * Makefile.in (CFILES): Add objalloc.c - (REQUIRED_OFILES): Add objalloc.o. - (objalloc.o): New target. - -Sat Mar 15 18:49:41 1997 Ian Lance Taylor <ian@cygnus.com> - - * obstack.c: Update to current FSF version. - -Fri Mar 14 14:18:47 1997 Ian Lance Taylor <ian@cygnus.com> - - * cplus-dem.c: Add prototypes for all static functions. - (mystrstr): Make static. Make arguments and result const. - (cplus_match): Remove; not used. - -Tue Mar 11 14:20:31 1997 Brendan Kehoe <brendan@lisa.cygnus.com> - - * cplus-dem.c (gnu_special): Call demangled_fund_type for other - __t* symbols. - -Tue Mar 11 15:41:21 1997 H.J. Lu <hjl@lucon.org> - - * spaces.c: Declare malloc and free properly. - * strsignal.c (init_signal_tables): Add prototype. - * xatexit.c (_xexit_cleanup): Add parameter declarations. - -Wed Feb 19 15:43:24 1997 Brendan Kehoe <brendan@lisa.cygnus.com> - - * Makefile.in (lneeded-list): If alloca.o is needed, xexit.o is - also required because of xmalloc.o. - -Fri Feb 14 13:43:38 1997 Ian Lance Taylor <ian@cygnus.com> - - * strsignal.c: Unconditionally redefine sys_siglist around the - inclusion of the system header files. - -Thu Feb 13 22:01:04 1997 Klaus Kaempf <kkaempf@progis.de> - - * makefile.vms: Remove 8 bit characters. Update to latest - gcc release. - -Tue Feb 4 11:52:19 1997 Ian Lance Taylor <ian@cygnus.com> - - * strsignal.c: Use NEED_sys_siglist instead of - LOSING_SYS_SIGLIST. - * config.table: Don't use mh-lynxos. - * config/mh-lynxos: Remove. - -Thu Jan 16 14:51:03 1997 Bob Manson <manson@charmed.cygnus.com> - - * cplus-dem.c: Fix indenting; make identical to the copy - in GCC. - (do_type, case 'M'): Check for a template as well as a class. - -Thu Dec 19 13:51:33 1996 Brendan Kehoe <brendan@lisa.cygnus.com> - - * config/mt-vxworks5 (vxneeded-list): Remove sigsetmask.o, since - vxworks 5.[0-3] all have sigsetmask in them; the one provided by - libiberty is incorrect, as well. - -Mon Dec 2 15:03:42 1996 Michael Meissner <meissner@tiktok.cygnus.com> - - * alloca.c (alloca): When compiled with an ANSI/ISO compiler, - alloca takes a size_t argument, not just unsigned. - -Mon Nov 18 15:42:08 1996 Jason Merrill <jason@yorick.cygnus.com> - - * cplus-dem.c: Note that this file also lives in GCC. - -Mon Nov 18 15:19:00 1996 Dawn Perchik <dawn@critters.cygnus.com> - - * alloca.c: Remove include of libiberty.h for hpux. - * argv.c: Replace defs from libiberty.h. - * spaces.c: Put back externs from removed from libiberty.h. - * vasprintf.c: Remove include of libiberty.h for hpux. - -Mon Nov 18 14:08:00 1996 Dawn Perchik <dawn@critters.cygnus.com> - - * cplus-dem.c: Checking in again; last checkin filed due to sticky tag. - -Wed Nov 13 08:22:00 1996 Dawn Perchik <dawn@critters.cygnus.com> - - * cplus-dem.c: Revert last two commits due to conflicts with - hpux system headers. - -Wed Nov 13 08:22:00 1996 Dawn Perchik <dawn@critters.cygnus.com> - - * alloca.c, argv.c, spaces.c, strcasecmp.c, vasprintf.c, vprintf.c: - Revert last commit due to conflicts with hpux system headers. - -Wed Nov 13 10:36:50 1996 Michael Meissner <meissner@tiktok.cygnus.com> - - * cplus-dem.c (x{m,re}alloc): Make declarations compatibile with - libiberty.h when compiled with a standard compiler. - -Tue Nov 12 16:31:00 1996 Dawn Perchik <dawn@critters.cygnus.com> - - * alloca.c: Include libiberty.h for definition of xmalloc. - Don't redefine NULL. - * argv.c: Move prototypes to libiberty.h. - * cplus-dem.c: Include libiberty.h for definition of xmalloc. - Don't redefine NULL. - Use casts to eliminate compiler warnings. - * spaces.c: Remove prototypes for malloc and free which are - already in libibrty.h. - * strcasecmp.c: Use casts to eliminate compiler warnings. - * vasprintf.c: Include libiberty.h for definition of malloc. - Don't redefine NULL. - * vprintf.c: Include stdarg.h if __STDC__. - -Fri Oct 11 15:42:12 1996 Stu Grossman (grossman@critters.cygnus.com) - - * config/mh-windows: Add strcasecmp.o to EXTRA_OFILES. - -Fri Oct 11 11:16:31 1996 Stan Shebs <shebs@andros.cygnus.com> - - * mpw.c (mpwify_filename): Rewrite to simplify, and to handle - upward components correctly. - -Tue Oct 8 08:55:34 1996 Stu Grossman (grossman@critters.cygnus.com) - - * config.table, config/mh-windows: Add support for building under - MSVC (the Microsoft build environment). - -Mon Oct 7 10:50:27 1996 Ian Lance Taylor <ian@cygnus.com> - - * fnmatch.c: Undef const if not __STDC__. - -Thu Oct 3 13:46:39 1996 Ian Lance Taylor <ian@cygnus.com> - - * fnmatch.c: New file. - * Makefile.in (CFILES): Add fnmatch.c. - (REQUIRED_OFILES): Add fnmatch.o. - (fnmatch.o): New target. - -Wed Sep 18 14:49:13 1996 Jason Merrill <jason@yorick.cygnus.com> - - * cplus-dem.c (demangle_template): Fix handling of address args. - (gnu_special): Handle type_info stuff. - -Fri Sep 13 17:52:55 1996 Stan Shebs <shebs@andros.cygnus.com> - - * mpw.c (DebugPI): Make settable from the env var DEBUG_PATHNAMES. - (mpwify_filename): Handle "::/" case. - -Thu Sep 12 13:30:40 1996 Geoffrey Noer <noer@cygnus.com> - - * config/mh-cygwin32: new file (need -DNEED_basename and - -DNEED_sys_siglist for native NT rebuilding) - * config.table (*-*-cygwin32): new entry - * choose-temp.c: bring in sync with gcc (revert Aug 17 change) - -Thu Aug 29 16:48:45 1996 Michael Meissner <meissner@tiktok.cygnus.com> - - * config.table (i[345]86-*-*): Recognize i686 for pentium pro. - -Tue Aug 27 13:47:58 1996 Stan Shebs <shebs@andros.cygnus.com> - - * pexecute.c (pexecute) [MPW]: Remove old bogus code that - messed with arguments that included a '/', add escape chars - to double quotes, remove const decl from arg that Mac - compilers don't seem to like. - -Sat Aug 17 04:44:27 1996 Geoffrey Noer <noer@cygnus.com> - - * pexecute.c: Update test for win32 (&& ! cygwin32). - * choose-temp.c: fix WIN32 preprocessor defines - -Thu Aug 15 12:26:48 1996 Stan Shebs <shebs@andros.cygnus.com> - - * mpw-make.sed: Add @DASH_C_FLAG@ and @SEGMENT_FLAG({Default})@ - to editing of default makefile rule. - -Sun Aug 11 21:03:27 1996 Stu Grossman (grossman@critters.cygnus.com) - - * alloca-norm.h: Include <malloc.h> if _WIN32. - * argv.c: Include non-prototyped decls for malloc and string - functions if ! _WIN32 or if __GNUC__. - -Thu Aug 8 12:42:40 1996 Klaus Kaempf <kkaempf@progis.de> - - * config.h-vms: New file. - * makefile.vms: Use it. - -Wed Aug 7 17:16:12 1996 Stu Grossman (grossman@critters.cygnus.com) - - * getopt.c (_getopt_internal): If argc is 0, just return (before - we reference *argv and segfault). - -Mon Aug 5 01:29:08 1996 Jason Merrill <jason@yorick.cygnus.com> - - * Makefile.in (distclean): Add multilib.out. - -Thu Jul 18 17:40:55 1996 Ian Lance Taylor <ian@cygnus.com> - - * alloca-norm.h: Change #ifdef sparc to #if defined (sparc) && - defined (sun). From Andrew Gierth <ANDREWG@microlise.co.uk>. - -Mon Jul 1 13:40:44 1996 Ken Raeburn <raeburn@cygnus.com> - - Tue May 28 15:29:03 1996 Pat Rankin <rankin@eql.caltech.edu> - - * vmsbuild.com (REQUIRD_OFILES): Add choose-temp.o and xstrdup.o. - - Thu Jan 25 18:20:04 1996 Pat Rankin <rankin@eql.caltech.edu> - - * vmsbuild.com: Changes to handle DEFFUNC(on_exit). - (do_ofiles): Allow nonexistent source file in pass 3. - (chk_deffunc): New routine. - -Tue Jun 25 19:24:43 1996 Doug Evans <dje@canuck.cygnus.com> - - * pexecute.c (PEXECUTE_VERBOSE): Define. - (MPW pexecute): Check flags & PEXECUTE_VERBOSE instead of verbose_flag. - -Tue Jun 25 23:11:48 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (docdir): Removed. - -Tue Jun 25 23:01:07 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (oldincludedir): Removed. - -Tue Jun 25 22:50:07 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (datadir): Set to $(prefix)/share. - -Thu Jun 20 21:17:52 1996 Ian Lance Taylor <ian@cygnus.com> - - * cplus-dem.c (demangle_arm_pt): Reindent. Avoid endless loop by - checking for errors from do_type. - -Tue Jun 18 14:36:19 1996 Klaus Kaempf <kkaempf@progis.de> - - * makefile.vms: New file. - * xmalloc.c: If VMS, include <stdlib.h> and <unixlib.h> rather - than declaring malloc, realloc, and sbrk. - -Mon Jun 10 13:17:17 1996 Doug Evans <dje@canuck.cygnus.com> - - * pexecute.c: New file. - -Wed Jun 5 16:57:45 1996 Richard Henderson <rth@tamu.edu> - - * xmalloc.c: Declare sbrk. - -Sat May 4 05:08:45 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * alloca-norm.h: Add SPARCworks cc compatible __builtin_alloca - declaration. - -Mon Apr 22 18:41:49 1996 Ian Lance Taylor <ian@cygnus.com> - - * xstrerror.c: Include <stdio.h>. - -Sun Apr 21 11:55:12 1996 Doug Evans <dje@canuck.cygnus.com> - - * Makefile.in (CFILES): Add atexit.c. - -Sun Apr 21 09:50:09 1996 Stephen L Moshier (moshier@world.std.com) - - * choose-temp.c: Include sys/types.h before sys/file.h for sco3.2v5. - -Wed Apr 17 11:17:55 1996 Doug Evans <dje@canuck.cygnus.com> - - * choose-temp.c: Don't #include sys/file.h ifdef NO_SYS_FILE_H. - #include <stdio.h> - * config/mt-vxworks5 (HDEFINES): Define NO_SYS_FILE_H. - -Tue Apr 16 11:27:16 1996 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (lneeded-list): If alloca.o is needed, so is xmalloc.o. - Reverts Feb 8, 1995 change. - -Mon Apr 15 12:53:26 1996 Doug Evans <dje@canuck.cygnus.com> - - * choose-temp.c: New file. - * Makefile.in (CFILES): Add choose-temp.c. - (REQUIRED_OFILES): Add choose-temp.o. - -Sat Apr 13 14:19:30 1996 Stu Grossman (grossman@critters.cygnus.com) - - * floatformat.c (floatformat_to_double): Don't bias exponent when - handling zero's, denorms or NaNs. - -Thu Apr 11 13:36:56 1996 Stu Grossman (grossman@critters.cygnus.com) - - * floatformat.c (floatformat_to_double): Fix bugs with handling - numbers with fractions < 32 bits. - -Mon Apr 8 14:48:34 1996 Ian Lance Taylor <ian@cygnus.com> - - * config.table: Permit --enable-shared to specify a list of - directories. - -Tue Mar 19 22:02:07 1996 Jason Merrill <jason@yorick.cygnus.com> - - * cplus-dem.c (demangle_template): Fix for non-mangled pointer - arguments. - -Fri Mar 8 17:24:18 1996 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: If srcdir is `.' and with_target_subdir is not - `.', then set MULTISRCTOP before calling config-ml.in. - -Thu Mar 7 13:37:10 1996 Stan Shebs <shebs@andros.cygnus.com> - - * mpw.c (mpw_open): Add debugging output option. - -Wed Mar 6 17:36:03 1996 Jason Merrill <jason@yorick.cygnus.com> - - * cplus-dem.c (demangle_template): Fix for address-of-extern arguments. - -Tue Feb 27 12:00:50 1996 Raymond Jou <rjou@mexican.cygnus.com> - - * mpw.c (mpwify_filename): Change 6 to 5 in - strncmp (unixname, "/tmp/", 5). - -Tue Feb 20 10:55:53 1996 Ian Lance Taylor <ian@cygnus.com> - - * cplus-dem.c (demangle_template): Initialize is_bool. Correctly - handle 0 as a pointer value parameter. - -Mon Feb 5 16:41:44 1996 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (all): Depend upon required-list. - (required-list): New target. - (clean): Remove required-list. - -Wed Jan 31 10:19:41 1996 Steve Chamberlain <sac@slash.cygnus.com> - - * win32.c: Deleted. - * config.table (i386-*-win32): Deleted. - * config/mh-i386win32: Deleted. - -Thu Jan 18 11:34:17 1996 Ian Lance Taylor <ian@cygnus.com> - - * cplus-dem.c (cplus_demangle_opname): Change opname parameter to - const char *. - (cplus_mangle_opname): Change return type and opname parameter to - const char *. Don't cast return value. - -Tue Jan 16 12:13:11 1996 Stan Shebs <shebs@andros.cygnus.com> - - * mpw.c: Include Timer.h, in order to get m68k Microseconds trap - definition. - -Wed Jan 3 13:15:04 1996 Fred Fish <fnf@cygnus.com> - - * obstack.c: Update copyright to 1996. - (_obstack_memory_used): Define new function. Called via - obstack_memory_used macro. - -Thu Dec 28 11:39:40 1995 Ian Lance Taylor <ian@cygnus.com> - - * xstrdup.c: New file. - * Makefile.in (CFILES): Add xstrdup.c. - (REQUIRED_OFILES): Add xstrdup.o. - (xstrdup.o): New target. - -Mon Dec 11 18:18:52 1995 Mike Stump <mrs@cygnus.com> - - * atexit.c: New stub to provide atexit on systems that have - on_exit, like SunOS 4.1.x systems. - * functions.def (on_exit, atexit): Ditto. - -Mon Dec 11 15:42:14 1995 Stan Shebs <shebs@andros.cygnus.com> - - * mpw.c (mpw_abort): Remove decl. - (mpw_access): Move debugging printf. - -Sat Dec 2 01:25:23 1995 Ian Lance Taylor <ian@cygnus.com> - - * config.table: Consistently use ${host} rather than ${xhost} or - ${target}. - * configure.in: Don't bother to set ${xhost} before calling - config.table. - -Tue Nov 28 14:16:57 1995 Brendan Kehoe <brendan@lisa.cygnus.com> - - * Makefile.in (.c.o): Use test instead of the left bracket, to - avoid problems with some versions of make. - -Tue Nov 28 11:45:17 1995 Stan Shebs <shebs@andros.cygnus.com> - - * mpw-make.sed: Fix INCDIR edit to work with Nov 14 change. - -Tue Nov 21 11:26:34 1995 Fred Fish <fnf@rtl.cygnus.com> - - * config/mh-hpux: Remove. It was only used to define EXTRA_OFILES, - which was set to just alloca.o, which is now automatically marked - as needed by the autoconfiguration process. - -Tue Nov 21 14:15:06 1995 Ian Lance Taylor <ian@cygnus.com> - - * config.table: Check ${with_cross_host} rather than comparing - ${host} and ${target}. - -Thu Nov 16 14:34:42 1995 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: If with_target_subdir is empty, set xhost to - ${host} rather than ${target} before calling config.table. - -Tue Nov 14 01:38:30 1995 Doug Evans <dje@canuck.cygnus.com> - - * Makefile.in (MULTITOP): Deleted. - (MULTISRCTOP, MULTIBUILDTOP): New. - (FLAGS_TO_PASS): Delete INCDIR. - (INCDIR): Add $(MULTISRCTOP). - (install_to_libdir): Add $(MULTISUBDIR). Call $(MULTIDO). - * configure.in: Delete call to cfg-ml-com.in. Call config-ml.in - instead of cfg-ml-pos.in. - (cross-compile check): Change to test for with_target_subdir. - (EXTRA_LINKS): Delete. - -Sun Nov 12 12:13:04 1995 Stan Shebs <shebs@andros.cygnus.com> - - * mpw-make.sed: Add getpagesize.c.o to needed-list. - * mpw.c [USE_MW_HEADERS]: Conditionalize compiling of - functions that are supplied by Metrowerks libraries. - (fstat): Clean up descriptor->pointer conversion code. - (InstallConsole, etc): Empty definitions, for when linking - with SIOUX. - -Sun Nov 5 19:25:27 1995 Per Bothner <bothner@kalessin.cygnus.com> - - * Makefile.in (FLAGS_TO_PASS): Also pass PICFLAGS. - (.c.o): Stylistic change. - -Thu Nov 2 12:06:29 1995 Ian Lance Taylor <ian@cygnus.com> - - * strtol.c, strtoul.c: Don't include <stdlib.h>. From - phdm@info.ucl.ac.be (Philippe De Muyter). - -Wed Nov 1 11:59:36 1995 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Correct sed call. - -Mon Oct 30 13:03:45 1995 Per Bothner <bothner@kalessin.cygnus.com> - - * configure.in: Clean up / simplify for native. - - * configure.in: Merge in stuff from ../xiberty/configure.in. - * Makefile.in (CC): Add definition (so it can be overrridden - by ../configure). - -Tue Oct 24 17:57:27 1995 Stan Shebs <shebs@andros.cygnus.com> - - * mpw-make.sed: Leave strerror.c.o in standard list of functions. - * mpw.c (R_OK, ENOENT, EACCESS, ENOSYS): Remove. - (link): Remove useless definition with error return. - (last_microseconds, warn_if_spin_delay, record_for_spin_delay): - Use UnsignedWide type for microsecond counts. - -Thu Oct 19 10:52:07 1995 Michael Meissner <meissner@wogglebug.tiac.net> - - * memcmp.c (memcmp): Argument types are const void *, not void - *const. - - * strncasecmp.c (strncasecmp): Include ansidecl.h/stdarg.h, not - sys/types.h. - * strcasecmp.c (strcasecmp): Ditto. - -Tue Oct 10 11:03:24 1995 Fred Fish <fnf@cygnus.com> - - * Makefile.in (BISON): Remove macro. - -Tue Sep 26 15:06:46 1995 Stan Shebs <shebs@andros.cygnus.com> - - * Makefile.in (HFILES): Add default empty definition. - * mpw-config.in (config.h): Only update if changed. - * mpw-make.in: Remove. - * mpw-make.sed: New file, edits Makefile.in into MPW makefile. - * mpw.c: Remove semi-clone of strerror code. - (sys_nerr, sys_errlist): Define here. - (Microseconds): Only define as A-line trap if m68k Mac. - -Wed Sep 20 12:53:32 1995 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (maintainer-clean): New synonym for distclean. - -Mon Aug 28 19:47:52 1995 Per Bothner <bothner@kalessin.cygnus.com> - - * config.table: For host, generalize rs6000-ibm-aix* - to *-ibm-aix* so we also include powerpc. - -Tue Aug 22 03:18:05 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com> - - Fri Jun 16 18:35:40 1995 Pat Rankin (rankin@eql.caltech.edu) - - * xstrerror.c: New file. - * Makefile.in, vmsbuild.com: Compile it. - -Mon Jul 31 12:16:32 1995 steve chamberlain <sac@slash.cygnus.com> - - * config.table (i386-*-win32): New. - -Fri Jul 21 11:35:52 1995 Doug Evans <dje@canuck.cygnus.com> - - * Makefile.in (MULTITOP): New variable. - (MULTIDIRS, MULTISUBDIR, MULTIDO, MULTICLEAN): Likewise. - (all): Add multilib support. - (install_to_tooldir, *clean): Likewise. - -Mon Jul 10 11:47:27 1995 Ken Raeburn <raeburn@cygnus.com> - - * makefile.dos (OBJS): Add hex.o. From DJ Delorie. - -Fri Jun 30 17:28:59 1995 Pat Rankin (rankin@eql.caltech.edu) - - * vmsbuild.com: create "new-lib.olb", build libiberty under that - name, and then make it become "liberty.olb" when done, so that an - incomplete build attempt never leaves behind something which looks - like a complete library. - -Thu Jun 29 00:22:02 1995 Steve Chamberlain <sac@slash.cygnus.com> - - * config/mh-i386pe: New file for PE hosts. - * config.table: Understand PE hosts. - -Wed Jun 28 19:13:23 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * cplus-dem.c: Update from gcc. - - * argv.c, dummy.c: If __STDC__, #include "alloca-conf.h" after - <stddef.h>. - * alloca-norm.h: If __STDC__, declare alloca with its parameter. - -Thu Jun 22 18:57:47 1995 Stan Shebs <shebs@andros.cygnus.com> - - * mpw-make.in (ALL_CFLAGS): Define NEED_basename. - * mpw.c: Only test DebugPI once whenever printing debug info. - (mpwify_filename): If filename is /tmp/foo, change it into :_foo, - also fix to not write on input filename buffer. - (mpw_access): Use stat() instead of open(), works for directories - as well as files. - -Mon Jun 19 00:33:22 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * Makefile.in: Massage broken shells that require 'else true'. - -Sat Jun 17 23:21:58 1995 Fred Fish <fnf@cygnus.com> - - * alloca-norm.h: Declare alloca as type "PTR" to match functions.def. - Declare __builtin_alloca in the sparc case, as argv.c did. - * argv.c: Replace inline version of alloca-norm.h at start of file with - a #include of alloca-conf.h. Precede it with an include of ansidecl.h - because alloca-norm.h needs to declare alloca as "PTR". - -Mon Jun 12 14:24:26 1995 Steve Chamberlain <sac@slash.cygnus.com> - - * win32.c: New file. - -Fri Jun 9 15:16:14 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * dummy.c: #include "alloca-conf.h". - -Wed Jun 7 11:46:23 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * Makefile.in (mostlyclean): Remove stamp-picdir. - (clean): Don't. - -Mon Jun 5 18:46:06 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * config.table (frags): Use toplevel pic frags. - - * Makefile.in (PICFLAG): New macro. - (all): Depend on stamp-picdir. - (needed-list): Ditto. - (.c.o): Also build pic object. - (stamp-picdir): New rule. - (mostlyclean): Remove pic. - (clean): Remove stamp-picdir. - -Fri Mar 24 16:55:48 1995 Pat Rankin (rankin@eql.caltech.edu) - - * vmsbuild.com (config.h): Add `#define NEED_basename'. - -Tue May 23 10:12:46 1995 Per Bothner <bothner@kalessin.cygnus.com> - - * clock.c, getopt.c, strtod.c, vsprintf.c: Change from using LGPL - to libio-style copyright. - * getpagesize.c: Remove FSF copyright. - -Sat May 20 12:30:23 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com> - - Added improved VMS support from Pat Rankin: - - Fri Mar 17 18:40:36 1995 Pat Rankin (rankin@eql.caltech.edu) - - * vmsbuild.com: new file. - - * getpagesize.c (getpagesize): implement for VMS; - * strerror.c (strerror, strerrno, strtoerrno): add rudimentary - support for EVMSERR. - -Thu May 18 17:01:42 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com> - - Wed May 10 14:28:16 1995 Richard Earnshaw (rearnsha@armltd.co.uk) - - * floatformat.c (floatformat_arm_ext): Define. - -Tue May 16 13:30:59 1995 Per Bothner <bothner@kalessin.cygnus.com> - - * basename.c, bcmp.c, getcwd.c, insque.c, rename.c, sigsetmask.c, - strerror.c, strsignal.c: Remove FSF copyright. - * sigsetmask.c: #include <sys/types.h> - seems to be needed by ISC. - -Mon May 15 19:53:17 1995 Per Bothner <bothner@kalessin.cygnus.com> - - * bcopy.c, bzero.c, memcmp.c, memcpy.c, memset.c, strchr.c, - strrchr.c, strstr.c, vfork.c: Remove FSF Copyright, because this - might contaminate libstdc++ with the LGPL. (OK'd by RMS 11 Oct 94.) - * strchr.c, strrchr.c: Add cast to suppress const warning. - -Thu May 4 14:36:42 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * cplus-dem.c: Use const instead of CONST. Don't include - ansidecl.h directly. - -Wed Apr 19 01:30:27 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * cplus-dem.c: Don't include libiberty.h. Do declare xmalloc and - xrealloc. - (-DMAIN): Don't rely on an externally-defined version number; - instead, require the version number to be defined as a - preprocessor macro. Handle the RS/6000 leading dot. Define - xmalloc, xrealloc and fatal. Don't strip a leading underscore - if we couldn't demangle the word. - -Tue Apr 4 13:03:51 1995 Stan Shebs <shebs@andros.cygnus.com> - - (Old mpw.c change descriptions retained for informational value.) - * mpw.c (warning_threshold): Default to .4 sec. - (overflow_count, current_progress): New globals. - (warn_if_spin_delay): Include current progress type, - such as program name, in message. - (mpw_start_progress): Set current_progress variable from arg. - (mpw_end_progress): Report spin delays by power-of-two-size - buckets instead of constant-size buckets. - - * mpw.c: Clean up formatting, types, returns, etc. - (ENOSYS): Define. - (mpw_fread, mpw_fwrite): Define. - (sleep): Define correctly. - - * mpw.c: New code to implement cursor spinning support. - (umask): New function. - (mpw_fopen, mpw_fseek, stat, fstat): Call PROGRESS. - - * mpw.c (mpw_basename, mpw_mixed_basename): New functions, find - basenames for MPW and MPW/Unix filenames. - (mpw_special_init): New function, calls Macsbug if desired. - - * mpw.c: Add GPL notice. - (mpwify_filename): Add more transformations. - (mpw_fopen): Call mpwify_filename on file names. - (rename): Remove. - (chdir, getcwd): Add simple definitions. - - * mpw.c: Random cleanups, remove unused code bits. - Added copy of strerror.c for gcc's use. - (stat, fstat, _stat): New versions based on Guido van Rossum code. - - * mpw.c (mpw_fseek): Make it work correctly when doing SEEK_CUR. - - * mpw.c (stat): Remove hack definition, get from sys/stat.h. - (fork, vfork, etc): Print error messages if called. - (getrusage, sbrk, environ, isatty, link, utime, mkdir, rmdir, - rename, chown): Define. - - * mpw-config.in: New file, MPW version of configure.in. - * mpw-make.in: New file, MPW version of Makefile.in. - * mpw.c: New file, MPW compatibility routines. - -Fri Mar 24 14:10:30 1995 Jim Kingdon (kingdon@lioth.cygnus.com) - - * basename.c: Include config.h before checking for NEED_basename. - -Thu Mar 23 19:09:54 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * functions.def: Add DEFFUNC for basename. - - * basename.c: Only define basename if NEED_basename. - -Thu Mar 16 13:36:05 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * config.table: Fix --enable-shared logic for native builds. - -Mon Mar 13 11:05:11 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * cplus-dem.c (demangle_template): Demangle bool literals properly. - -Mon Mar 6 23:57:28 1995 Stu Grossman (grossman@cygnus.com) - - * strtol.c strtoul.c: Replace these with less buggy versions from - NetBSD. (strtoul in particular couldn't handle base 16.) - -Wed Mar 1 15:59:01 1995 Ian Lance Taylor <ian@cygnus.com> - - * config/mt-vxworks5 (HDEFINES): Define NO_SYS_PARAM_H. - - * clock.c: If NO_SYS_PARAM_H is defined, don't include - <sys/param.h>. - * getcwd.c, getpagesize.c, getruntime.c: Likewise. - -Fri Feb 17 15:40:55 1995 Ian Lance Taylor <ian@cygnus.com> - - * getruntime.c (get_run_time): Don't assume that CLOCKS_PER_SEC is - a number; ANSI appears to permit any expression, including a - function call. - - * config.table (*-*-vxworks5*): Use mt-vxworks5 when configuring - xiberty. - * config/mt-vxworks5: New file. - -Thu Feb 9 14:19:45 1995 Ian Lance Taylor <ian@cygnus.com> - - * basename.c (basename): Change argument to be const. - -Wed Feb 8 18:06:52 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * Makefile.in (lneeded-list): Don't worry about xmalloc. - -Sun Jan 15 00:40:36 1995 Jeff Law (law@snake.cs.utah.edu) - - * Makefile.in (distclean): Delete xhost-mkfrag. - -Thu Jan 12 16:54:18 1995 Jason Merrill <jason@phydeaux.cygnus.com> - - * Makefile.in (lneeded-list): If alloca.o is needed, so is xmalloc.o. - -Wed Jan 11 22:39:56 1995 Ken Raeburn <raeburn@cujo.cygnus.com> - - * hex.c: New file. - * Makefile.in (REQUIRED_OFILES, CFILES): List it. - (hex.o): Add dependencies. - - * cplus-dem.c (demangle_prefix): For GNU style constructor and - destructor names, try demangling the remainder of the string. - -Wed Dec 28 00:49:15 1994 Ian Lance Taylor <ian@tweedledumb.cygnus.com> - - * vasprintf.c (int_vasprintf): New static function. - (vasprintf): Use int_vasprintf. Removes assumption that va_list - is assignment compatible. - -Sat Nov 5 19:29:12 1994 Jason Merrill (jason@phydeaux.cygnus.com) - - * Makefile.in (LIBCFLAGS): New variable. - (FLAGS_TO_PASS): Pass it. - (.c.o): Use it. - -Thu Nov 3 19:09:47 1994 Ken Raeburn <raeburn@cujo.cygnus.com> - - * getopt.c, getopt1.c: Do compile these functions under Linux, - since many native versions are based on glibc but are buggy. - -Mon Oct 24 15:16:46 1994 Per Bothner <bothner@kalessin.cygnus.com> - - * vasprintf.c: Make 'format' arg be const, to avoid a mismatch - with prototype in GNU libc. Support stdarg.h as well as varargs.h. - -Tue Oct 11 17:48:27 1994 Jason Merrill (jason@phydeaux.cygnus.com) - - * Makefile.in (REQUIRED_OFILES): Add vasprintf.o. - * functions.def: Remove vasprintf. - -Wed Sep 14 17:04:55 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * xmalloc.c (first_break): New static variable. - (xmalloc_set_program_name): Record sbrk (0) in first_break. - (xmalloc): If memory allocation fails, try to report how much - memory was allocated by the program up to this point. - (xrealloc): Likewise. - -Sun Sep 04 17:58:10 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org) - - * Makefile.in (ERRORS_CC): New variable, defaulted to $(CC). Use it - when linking dummy. - * config.table: Add host RISCiX Makefile frag. - * config/mh-riscix: New file. - -Thu Aug 25 17:29:44 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * Makefile.in (FLAGS_TO_PASS): Define. - ($(RULE1)): Use $(FLAGS_TO_PASS). - -Wed Aug 24 17:08:47 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * vasprintf.c: Include <string.h>. - (vasprintf): Add casts to void for va_arg to avoid gcc warnings. - * xatexit.c: Declare malloc. - -Fri Aug 19 15:29:12 1994 Kung Hsu (kung@mexican.cygnus.com) - - * cplus-dem.c (demangle_args): Fix a bug in previous patch (the - one below). - -Thu Aug 18 14:37:14 1994 Kung Hsu (kung@mexican.cygnus.com) - - * cplus-dem.c (demangle args): Handle ARM repeat encoding where - the type index is greater than 9. - -Wed Aug 17 16:13:49 1994 Kung Hsu (kung@mexican.cygnus.com) - - * cplus-dem.c (demangle_qualified): accept optional '_' between - qualified name. This is baecause the template name may end with - numeric and can mixed up with the length of next qualified name. - -Wed Aug 3 05:52:14 1994 D. V. Henkel-Wallace (gumby@cygnus.com) - - * config/mt-sunos4: Use our standard location for cross-includes - and cross-libs when the target is also a "host" environment (ie no - newlib; includes and such don't belong to us). This is specific - to the Cygnus Support environment. - -Tue Aug 2 15:25:12 1994 Kung Hsu (kung@mexican.cygnus.com) - - * cplus-dem.c (demangle_template): demangle as xxx<'Q'> not - xxx<ch=81>. - -Mon Aug 1 17:02:48 1994 Kung Hsu (kung@mexican.cygnus.com) - - * cplus-dem.c (main): flush stdout to make pipe work. - -Sat Jul 16 12:56:32 1994 Stan Shebs (shebs@andros.cygnus.com) - - * config.table (*-*-cxux7*): Recognize. - * floatformat.c (floatformat_m88110_ext) [HARRIS_FLOAT_FORMAT]: - Harris-specific float format. - * config/mh-cxux7: New file. - -Wed Jun 29 00:26:17 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * cplus-dem.c (demangle_template): Make sure that the result of - consume_count doesn't index beyond the end of the string. - -Mon Jun 20 23:54:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * cplus-dem.c (gnu_special): Handle vtable mangling of gcc-2.4.5 and - earlier. Improve test for new vtable mangling. Change output back - to `virtual table'. - -Mon Jun 20 11:37:30 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * obstack.c: Always compile this code, even if using the GNU - library. Avoids problems with relatively recent binary - incompatibility. - -Thu Jun 16 17:54:01 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * cplus-dem.c: Include libiberty.h. - (xmalloc, xrealloc, free): Don't declare. - (strstr): Don't declare parameters. - (xmalloc, xrealloc): Don't define. - (long_options): Add no-strip-underscores. - (main): Call xmalloc_set_program_name. Pass n in short options to - getopt_long. Handle option 'n' to not strip underscores. - (usage): Mention -n and --no-strip-underscores. - -Sun Jun 12 01:37:09 1994 Jason Merrill (jason@deneb.cygnus.com) - - * cplus-dem.c (demangle_template): Separate consecutive >'s with a - space. - (gnu_special): Demangle template and qualified names in a vtable name. - -Fri May 27 12:27:52 1994 Ken Raeburn (raeburn@cujo.cygnus.com) - - From gas-2.3 and binutils-2.4 net releases: - - Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) - - * makefile.dos: [new] Makefile for dos/go32 - * configure.bat: update for latest files - * msdos.c: remove some functions now in libc.a - -Fri May 20 18:53:32 1994 Per Bothner (bothner@kalessin.cygnus.com) - - * cplus-dem.c (gnu_special): Recognize thunks, as well as - the new naming style for vtables (when -fvtable-thunks). - -Wed May 18 13:34:06 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * Makefile.in (XTRAFLAGS): Don't define. - (.c.o, dummy.o): Don't use XTRAFLAGS. - ($(RULE1)): Don't pass XTRAFLAGS down in recursive call. - -Fri May 13 16:02:12 1994 Jim Kingdon (kingdon@lioth.cygnus.com) - - * vasprintf.c: New file. - * Makefile.in, functions.def: Add it. - -Fri May 13 16:20:28 1994 Jason Merrill (jason@deneb.cygnus.com) - - * cplus-dem.c (demangle_fund_type): Grok bool. - -Fri May 6 14:44:21 1994 Steve Chamberlain (sac@cygnus.com) - - * config.table: Add go32 - * config/mh-go32: New template. - -Fri May 6 11:01:59 1994 D. V. Henkel-Wallace (gumby@rtl.cygnus.com) - - * config.table, config/mt-sunos4: config for when sun4 is cross target. - -Mon Apr 11 00:54:33 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * getopt.c [not __GNU_LIBRARY__] [__GCC__] [not __STDC__]: - Declare strlen to return int. Don't include stddef.h. - -Fri Apr 1 00:38:17 1994 Jim Wilson (wilson@mole.gnu.ai.mit.edu) - - * getopt.c: Delete use of IN_GCC to control whether - stddef.h or gstddef.h is included. - -Thu Apr 14 14:00:56 1994 Kung Hsu (kung@mexican.cygnus.com) - - * cplus-dem.c (demangle_signature): Fix a bug in template function - type numbering. - -Wed Apr 13 17:23:03 1994 Kung Hsu (kung@mexican.cygnus.com) - - * cplus-dem.c (demangle_signature): Fix template function with arm - style argument type number, Tn. - -Wed Apr 13 17:11:15 1994 Jason Merrill (jason@deneb.cygnus.com) - - * cplus-dem.c (optable): Add new[] and delete[]. - -Fri Apr 8 11:21:42 1994 Jim Kingdon (kingdon@deneb.cygnus.com) - - * argv.c (buildargv): Don't produce empty argument just because - there is trailing whitespace. - -Wed Apr 6 11:42:14 1994 Kung Hsu (kung@mexican.cygnus.com) - - * cplus-dem.c (demangle_template): fix 'Q' qualified name bug. - Handle 'p' same as 'P'. - * cplus-dem.c (do_type): Handle 'p' same as 'P'. - -Sat Mar 26 12:00:13 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * floatformat.c (get_field, put_field): Fix off by one error in - little endian case. - -Thu Mar 24 10:40:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com) - - * floatformat.c (floatformat_from_double): Pass unsigned char *, - not char *, to put_field. - -Fri Mar 18 12:34:33 1994 Per Bothner (bothner@kalessin.cygnus.com) - - * memmove.c: Re-wrote; placed in public domain. - -Wed Mar 16 10:33:07 1994 Jim Kingdon (kingdon@lioth.cygnus.com) - - * cplus-dem.c (demangle_prefix): If ARM demangling, don't treat - __Q* as a constructor. - -Mon Mar 14 12:26:02 1994 Ian Lance Taylor (ian@cygnus.com) - - * ieee-float.c: Removed; no longer used. - * Makefile.in: Changed accordingly. - -Mon Mar 7 12:28:17 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * floatformat.c (get_field): Removed unused local variable i. - (put_field): Removed unused local variable i. - -Sun Feb 27 21:50:11 1994 Jim Kingdon (kingdon@deneb.cygnus.com) - - * floatformat.c: New file, intended to replace ieee-float.c. - * Makefile.in: Change accordingly. - -Thu Feb 24 11:51:12 1994 David J. Mackenzie (djm@rtl.cygnus.com) - - * getopt.c: Remove #ifdef GETOPT_COMPAT and #if 0 code. - (_getopt_initialize): New function, broken out of _getopt_internal. - (_getopt_internal): - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - -Thu Feb 10 14:44:16 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * getopt.c [not __GNU_LIBRARY__] [__GNUC__] [not IN_GCC]: - Test just __STDC__, not emacs. - -Wed Feb 9 00:14:00 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * getopt.c [not __GNU_LIBRARY__] [__GNUC__] [not IN_GCC] - [emacs] [not __STDC__]: Don't include stddef.h. Don't declare strlen. - -Fri Dec 24 19:43:00 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * getopt.c (_NO_PROTO): Define before config.h is included. - -Mon Sep 20 15:59:03 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * getopt.c, getopt1.c [emacs || CONFIG_BROKETS]: Include - <config.h> only under these, else "config.h". - -Thu Aug 12 18:16:49 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - - * getopt.c, getopt1.c [HAVE_CONFIG_H]: Include - <config.h> instead of "config.h". - -Sun Feb 20 17:17:01 1994 Ian Lance Taylor (ian@lisa.cygnus.com) - - * concat.c: Check ANSI_PROTOTYPES rather than __STDC__ to decide - whether to use prototypes or not. - * strerror.c (const): Never undefine; let ansidecl.h handle it. - * strsignal.c (const): Likewise. - -Thu Feb 17 13:27:35 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * xatexit.c (_xexit_cleanup): Declare as extern; don't initialize. - Merging common and initialized variables need not be supported by - ANSI C compilers. - (xatexit): Initialize _xexit_cleanup if not already set. - * xexit.c: Comment fix. - -Wed Feb 16 01:15:36 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * xmalloc.c: Don't declare xexit; it's declared in libiberty.h. - (xrealloc): If oldmem is NULL, allocate with malloc, rather than - assuming that realloc works correctly. - -Tue Feb 15 09:26:16 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * concat.c, ieee-float.c: Replace inclusion of <string.h> - with explicit function declarations, as recommended by Ian Taylor. - -Sat Feb 12 10:31:11 1994 David J. Mackenzie (djm@rtl.cygnus.com) - - * xmalloc.c (xmalloc, xrealloc): Use PTR and size_t throughout. - (malloc, realloc): Declare. - -Thu Feb 10 17:08:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * argv.c, basename.c: Include ansidecl.h and libiberty.h. - * concat.c, fdmatch.c, getruntime.c, spaces.c: Likewise. - * strerror.c, strsignal.c, xatexit.c, xexit.c: Likewise. - * xmalloc.c: Likewise. - * concat.c: Don't declare xmalloc. If __STDC__, use <stdarg.h> - macros, not <varargs.h> macros. - * spaces.c (spaces): Make return type const. Don't crash if - malloc returns NULL. - * strerror.c (struct error_info): Make name and msg fields const. - (error_names): Make const. - (strerrno): Make const. - (strtoerrno): Make argument const. - * strsignal.c (struct signal_info): Make name and msg fields - const. - (signal_names, sys_siglist): Make const. - (strsignal, strsigno): Make const. - (strtosigno): Make argument const. - * xatexit.c: Declare parameter types. - * xmalloc.c (name): Make const. - (xmalloc_set_program_name): Make argument const. - * Makefile.in (INCDIR): Define. - (.c.o): Use $(INCDIR). - (dummy.o): Likewise. - (argv.o, basename.o): New targets; depend on libiberty.h. - (concat.o, fdmatch.o, getruntime.o, spaces.o): Likewise. - (strerror.o, strsignal.o, xatexit.o, xexit.o): Likewise. - (xmalloc.o): Likewise. - (cplus-dem.o): New target; depend on demangle.h. - (getopt.o, getopt1.o): New targets; depend on getopt.h. - (ieee-float.o): New target; depend on ieee-float.h. - (obstack.o): New target; depend on obstack.h. - -Tue Feb 8 05:29:08 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - Handle obstack_chunk_alloc returning NULL. This allows - obstacks to be used by libraries, without forcing them - to call exit or longjmp. - * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk): - If CALL_CHUNKFUN returns NULL, set alloc_failed, else clear it. - (_obstack_begin, _obstack_begin_1): Return 1 if successful, 0 if not. - -Tue Feb 8 00:32:28 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * concat.c, ieee-float.c: Include <string.h>. - -Sun Feb 6 21:28:46 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * xmalloc.c (xmalloc_set_program_name): New function. - (xmalloc, xrealloc): Include the name in the error message, if set. - - * Replace atexit.c with xatexit.c. - * Makefile.in (CFILES), functions.def: Change references. - -Sat Feb 5 14:02:32 1994 Stan Shebs (shebs@andros.cygnus.com) - - * getruntime.c (get_run_time): Use getrusage or times if - HAVE_GETRUSAGE or HAVE_TIMES are defined. - -Fri Feb 4 15:49:38 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * atexit.c: New file. - * Makefile.in (CFILES), functions.def: Add it. - * xexit.c: New file. - * Makefile.in (CFILES, REQUIRED_OFILES): Add it. - * xmalloc.c (xmalloc, xrealloc): Call xexit instead of exit. - Change request for 0 bytes into request for 1 byte. - -Wed Feb 2 11:36:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * xmalloc.c (xmalloc, xrealloc): Print size using %lu, and cast to - unsigned long, to avoid warnings. - -Fri Jan 28 17:49:06 1994 Ken Raeburn (raeburn@cujo.cygnus.com) - - * dummy.c: Don't include time.h ever; always define clock_t as - "unsigned long". Until gcc/fixincludes ensures that clock_t - exists, __STDC__ isn't a sufficient test. And if clock() doesn't - exist, clock_t probably doesn't either. - -Mon Jan 24 11:52:31 1994 Stan Shebs (shebs@andros.cygnus.com) - - * clock.c, getruntime.c: New files. - * Makefile.in: Add to file lists. - * functions.def (clock): Add to list. - * dummy.c (time.h): Add if __STDC__. - (clock_t): #define as "unsigned long" if not __STDC__. - -Tue Jan 11 11:27:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * strtod.c: Declare atof. From edler@jan.ultra.nyu.edu (Jan - Edler). - -Tue Dec 28 14:17:30 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * Makefile.in (errors): Use CFLAGS as well as LDFLAGS when - linking. - -Fri Dec 17 12:26:07 1993 Kung Hsu (kung@cirdan.cygnus.com) - - * cplus-dem.c (demangle_arm_pt): New function. Common code - for ARM template demangling. - * cplus-dem.c (demangle_class_name): Use demangle_arm_pt. - * cplus-dem.c (demangle_prefix): Likewise. - -Tue Nov 30 15:47:48 1993 Jason Merrill (jason@deneb.cygnus.com) - - * cplus-dem.c (cplus_demangle_opname): Add CONST to please gcc. - -Sat Nov 27 11:05:50 1993 Fred Fish (fnf@cygnus.com) - - Merge changes from tom@basil.icce.rug.nl (Tom R.Hageman) - * strerror.c, strsignal.c: As a small space optimization, don't - include messages when they aren't actually used. - - Merge changes from takefive.co.at!joe (Josef Leherbauer) - * cplus-dem.c (demangle_prefix, demangle_function_name, - cplus_demangle_opname): Fixes for systems where cplus_marker - is something other than '$'. - -Fri Nov 26 13:51:11 1993 Per Bothner (bothner@kalessin.cygnus.com) - - * waitpid.c: Simple-minded approcimation to waitpid - using vanilla wait. - * functions.def, Makefile.in: Update accordingly, - -Thu Nov 18 18:01:15 1993 Kung Hsu (kung@cirdan.cygnus.com) - - * cplus-dem.c(demangle_template): fix bug template instantiation - with value of user defined type. - -Wed Nov 17 18:30:21 1993 Kung Hsu (kung@cirdan.cygnus.com) - - * cplus-dem.c(cplus_demangle_opname): add the subject new function - to support unified search of operator in class. - -Wed Nov 10 09:47:22 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - gcc -Wall lint: - * strtoul.c (strtoul): use "(digit = *s) != '\0'" not just - "digit = *s" as condition in while loop. - -Tue Nov 9 15:52:22 1993 Mark Eichin (eichin@cygnus.com) - - * Makefile.in: pass SHELL to recursive make - -Thu Nov 4 12:09:26 1993 Per Bothner (bothner@kalessin.cygnus.com) - - * vfprintf.c, vprintf.c, vsprintf.c: Make format arg - be (const char*), for ANSI (and gcc w/fixproto) consistency. - -Thu Nov 4 08:29:04 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * config.table: Make *-*-hiux* use mh-hpux. - -Fri Oct 22 07:53:15 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * config.table: Add * to end of all OS names. - -Tue Oct 19 17:12:01 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - * Makefile.in (lneeded-list): ensure that object file names are - not duplicated, as multiple instances of the same object file in - a library causes problems on some machines - -Mon Oct 18 21:59:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * strcasecmp.c, strncasecmp.c: Change u_char to unsigned char. - -Fri Oct 15 22:17:11 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - * strncasecmp.c: new file, implements strncasecmp - * strcasecmp.c: new file, implement strcasecmp - - * Makefile.in (CFILES): list these two new source files - - * functions.def: add strcasecmp and strncasecmp entries - -Fri Oct 15 14:53:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * strtoul.c (strtoul), strtol.c (strtol): Handle overflow - according to ANSI C. - -Thu Oct 14 16:34:19 1993 Kung Hsu (kung@cirdan.cygnus.com) - - * cplus-dem.c: add support of ARM global constructor/destructor, - and 'G' for passing record or union in parameter. - -Wed Oct 13 13:36:19 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * Makefile.in: Fix comment to clarify that stuff in REQUIRED_OFILES - should not be in functions.def. - -Wed Oct 13 13:13:38 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * functions.def: Removed xmalloc. Stuff in REQUIRED_OFILES should - not be in functions.def. - -Mon Oct 4 18:26:39 1993 Kung Hsu (kung@cirdan.cygnus.com) - - * cplus-dem.c: change globl constructor/destructor to proper name - -Tue Sep 28 18:11:07 1993 Kung Hsu (kung@cirdan.cygnus.com) - - * cplus-dem.c: fix bug in constructor/destructor - -Tue Sep 28 16:20:49 1993 Kung Hsu (kung@cirdan.cygnus.com) - - * cplus-dem.c: support both old and new _vt$... vtbl mangled names - -Fri Sep 24 19:07:16 1993 Jason Merrill (jason@deneb.cygnus.com) - - * cplus-dem.c: Fix demangle_template prototype - -Fri Sep 24 17:32:55 1993 Kung Hsu (kung@cirdan.cygnus.com) - - * cplus-dem.c: fix template demangling - * cplus-dem.c: fix const type demangling - * cplus-dem.c: fix constructor/destructor, virtual table, - qualifier, global constructor/destructor demangling - -Wed Sep 1 23:13:11 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * strsignal.c, strerror.c: Use fully-bracketed initializer to - keep gcc -Wall happy. - -Fri Aug 27 10:30:09 1993 Jason Merrill (jason@deneb.cygnus.com) - - * cplus-dem.c (do_type): Add CONSTS to make gcc happy with last - patch. - -Fri Aug 27 11:24:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - Patch from Paul Flinders: - * cplus-dem.c (do_type): Deal with arrays. - -Tue Aug 24 14:23:50 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * cplus-dem.c (demangle_qualified: Deal with GNU format for more - than 9 classes. - -Wed Aug 18 19:50:29 1993 Jason Merrill (jason@deneb.cygnus.com) - - * Makefile.in (dummy.o): Redirect to /dev/null to avoid "variable - not initialized" warnings under HP/UX - -Sun Aug 15 20:42:40 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * strerror.c: Move include of stdio.h after sys_errlist #define. - Also remove NULL definition (stdio.h always defines NULL, so it - never did anything but clutter up the code). - -Sat Aug 14 14:21:49 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - * Makefile.in, functions.def: handle xmalloc.c - - * xmalloc.c: provide xmalloc and xrealloc functions - -Thu Aug 12 17:38:57 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * cplus-dem.c: Fix a comment. - -Sat Aug 7 13:56:35 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * getopt1.c: Declare const the way getopt.c does. - -Fri Aug 6 17:03:13 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * obstack.c, alloca.c: Update from FSF. - * getopt.c, getopt1.c: Update to current FSF version, which - doesn't use alloca. - -Tue Jul 27 14:03:57 1993 Brendan Kehoe (brendan@lisa.cygnus.com) - - * Makefile.in (demangle): Add the target with a message saying - where demangle went. - -Mon Jul 26 15:49:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * Makefile.in: Remove obsolete `demangle' target. - -Thu Jul 22 08:31:01 1993 Fred Fish (fnf@deneb.cygnus.com) - - * cplus-dem.c (arm_special): Apply patch from arg@lucid.com to - avoid infinite loop on vtbl symbols with disambiguating "junk" - tacked on the end. - -Mon Jul 19 14:10:37 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - * strsignal.c: work around some systems losing definitions of - sys_siglist - - * config/mh-lynxos: this system has a losing definition of - sys_siglist - - * config.table: use mh-lynxos for *-*-lynxos - -Mon Jul 19 17:08:52 1993 Ken Raeburn (raeburn@rtl.cygnus.com) - - * config.table: Add support for HPPA BSD hosts. - - * config/mh-hpbsd: New file. - -Mon Jul 12 18:00:40 1993 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in (TAGS): make work when srcdir != objdir. - -Sun Jun 27 15:35:31 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * cplus-dem.c (main): Add long options, including --help and - --version. - (usage): New function from code in main. - -Tue Jun 22 11:37:38 1993 Per Bothner (bothner@deneb.cygnus.com) - - * config.table: New shell scipt, sourced by both ./configure,in - and ../xiberty/configure.in, to avoid maintainance lossages. - * configure.in and ../xiberty/configure.in: Use config.table. - - * configure.in: Don't use mh-aix for AIX 3.2, only for 3.1. - * configure.in: Map *-*-irix* (except irix4) to mh-sysv. - * ../xiberty/configure.in: Update from ./configure.in. - -Tue Jun 15 17:05:31 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: remove parentdir support - -Wed May 26 12:59:09 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * cplus-dem.c (xrealloc): Match definition with prototype. - -Tue May 25 14:27:51 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * cplus-dem.c (demangle_prefix): Demangle cfront - local variables as an extension to ARM demangling. - -Fri May 21 09:53:57 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * ieee-float.c: Don't require pointers to double to be aligned. - -Tue May 18 17:12:10 1993 Fred Fish (fnf@cygnus.com) - - (merge changes from dlong@cse.ucsc.edu) - * cplus-dem.c (consume_count): Simplify. - * cplus-dem.c (arm_pt, demangle_class_name): New functions. - * cplus-dem.c (various): Calls to arm_pt, demangle_class_name. - - * cplus-dem.c (xmalloc, xrealloc, strstr): Make extern decls into - full prototypes. - * cplus-dem.c (free): Add prototype. - * cplus-dem.c (optable): Fully bracketize initializer. - -Fri May 14 17:13:05 1993 Per Bothner (bothner@cygnus.com) - - * cplus-dem.c: Whether initial underscores are stripped - depends on the external variable prepends_underscore - (which is generated by the binutils Makefile). - -Fri May 14 07:32:20 1993 Ken Raeburn (raeburn@deneb.cygnus.com) - - * cplus-dem.c (mop_up, arm_special): Remove some unused variables. - -Tue May 4 20:31:59 1993 Fred Fish (fnf@cygnus.com) - - * cplus-dem.c (consume_count): Return zero if arg does not - start with digit, and don't consume any input. - -Tue May 4 08:10:28 1993 Jim Kingdon (kingdon@cygnus.com) - - * Makefile.in (demangle): Use ${srcdir} not $^. - - * strtod.c: New file, needed at least for BSD 4.3. - -Sun May 2 11:30:42 1993 Fred Fish (fnf@cygnus.com) - - * strsignal.c (sys_siglist): For ANSI compilations, type is - "const char *const". Also remove conditionalization on __STDC__ - since const is defined away for non-ANSI. - -Wed Apr 28 19:29:55 1993 Ken Raeburn (raeburn@deneb.cygnus.com) - - * configure.in: Recognize *-*-hpux. - * config/mh-hpux: New file. - -Tue Apr 27 15:22:19 1993 Per Bothner (bothner@cygnus.com) - - * tmpnam.c: Added ANSI tmpnam() function. - * functions.def, Makefile.in: Update accordingly. - -Tue Apr 27 13:38:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * cplus-dem.c (demangle_function_name): Get the demangling of - stop__1A right. - -Fri Apr 16 23:48:24 1993 Jim Kingdon (kingdon at calvin) - - * cplus-dem.c: Declare strstr return type. - -Fri Mar 26 12:01:26 1993 Jim Kingdon (kingdon@cygnus.com) - - * strsignal.c: Add some AIX signals. - -Thu Mar 25 15:17:23 1993 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in (MAKEOVERRIDES): Define to be empty. - -Wed Mar 24 01:59:25 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com) - - * Makefile.in: add installcheck & dvi targets - -Thu Mar 18 14:05:44 1993 Per Bothner (bothner@rtl.cygnus.com) - - * ieee-float.c: New file, moved from ../gdb (since it is - needed by ../opcode/m68k-dis.c). - -Tue Mar 2 17:47:31 1993 Fred Fish (fnf@cygnus.com) - - * cplus-dem.c: Replace all references to cfront with ARM. - -Fri Feb 26 00:17:07 1993 Per Bothner (bothner@rtl.cygnus.com) - - * cplus-dem.c: Fix main program (when compiled with -DMAIN) - to be more useful as a filter. - -Sat Feb 20 21:41:39 1993 Brendan Kehoe (brendan@lisa.cygnus.com) - - * Makefile.in (install_to_libdir, install_to_tooldir): Go into the - destination directory before running $(RANLIB), in case that - program tries to create a file in the current directory as part of - its work. - -Thu Feb 18 23:00:19 1993 John Gilmore (gnu@cygnus.com) - - * strsignal.c (sys_siglist): Remove yet another *%^&%&$# "const" - because BSD 4.4 lacks one. Isn't this fun? - -Thu Feb 18 11:24:25 1993 Fred Fish (fnf@cygnus.com) - - * cplus-dem.c (demangle_signature): Set func_done after - demangling a template. - * cplus-dem.c (demangle_template): Fix several small bugs - in demangling GNU style templates. - * cplus-dem.c (demangle_prefix): Fix for templates in GNU - style constructors. - * cplus-dem.c (gnu_special): Fix for templates in GNU style - static data members. - -Tue Feb 16 17:28:35 1993 Fred Fish (fnf@cygnus.com) - - * cplus-dem.c (demangle_signature): Modify to include type - modifiers like static and const in remembered types. - -Thu Feb 11 22:20:47 1993 Fred Fish (fnf@cygnus.com) - - * cplus-dem.c (demangled_qualified): Add new parameter that tells - whether to prepend or append the qualifiers. - * cplus-dem.c (string_prepends): Used now, remove #if 0. - * cplus-dem.c (demangle_signature): Call demangle_qualified - with prepending. - * cplus_dem.c (gnu_special): Recognize static data members that - use qualified names. - * cplus-dem.c (demangle_qualified): Accumulate qualifiers in a - temporary buffer and the prepend or append them to the result, - as specified by the new "append" flag. - * cplus-dem.c (do_type): Call demangled_qualified with - appending. - -Mon Dec 28 10:47:19 1992 Ken Raeburn (raeburn@cygnus.com) - - * strsignal.c (signal_table): Now const. - (init_signal_tables): Variable eip now points to const. - - * strerror.c (error_table): Now const. - (init_error_tables): Variable eip now points to const. - -Tue Dec 15 15:36:50 1992 Per Bothner (bothner@cygnus.com) - - * memchr.c (memchr): New (ANSI standard) function. - * Makefile.in, functions.def: Added memchr. - * Makefile.in (AR_FLAGS): Use rc instad of non-standard cq. - -Wed Dec 2 22:49:10 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * getopt.c: remove use of USG around <alloca.h>, which never meant - anything anyway - - * config/mh-{aix,apollo68,ncr3000,sysv,sysv4}: removed definitions - of USG and USGr4 - -Thu Nov 19 03:09:33 1992 Brendan Kehoe (brendan@lisa.cygnus.com) - - * cplus-dem.c (demangle_fund_type): Recognize `w', a wide character; - it's now a type according to the ANSI X3J16 working paper; output - "wchar_t" for it. - (demangle_template): Accept `w' as an integral type. - (xmalloc, xrealloc): Use `char *', not `PTR'. Cast calls to their - counterparts malloc and realloc to `char *'. - (main): Exit with a 0 status. - * Makefile.in (demangle): Don't expect the user to define - DEMANGLE, instead force to be cplus-dem.c. Look in $(srcdir)/../include - for demangle.h. Pass it any HDEFINES or XTRAFLAGS. - -Wed Nov 18 18:56:20 1992 John Gilmore (gnu@cygnus.com) - - * Makefile.in (AR_FLAGS): Avoid verbosity. - * config/mh-sysv4: Remove AR_FLAGS override, use INSTALL=cp, - replace USGr4 with HAVE_SYSCONF. - * config/mh-solaris: Remove; mh-sysv4 works now. - * getpagesize.c: Replace USGr4 with HAVE_SYSCONF. - * configure.in: Simplify host matching table, remove separate - solaris config file. - -Sun Nov 15 09:35:16 1992 Fred Fish (fnf@cygnus.com) - - * configure.in (i[34]86-*-solaris2*): Add, use mh-sysv4. - -Tue Nov 3 21:27:03 1992 Brendan Kehoe (brendan@cygnus.com) - - * cplus-dem.c (xmalloc, xrealloc): Add decls. - (remember_type): Don't cast xmalloc. - (string_need): Likewise; don't cast xrealloc either. - -Fri Oct 23 08:52:01 1992 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in, functions.defs, rename.c: added simple - implementation of rename, since some binutils programs use it. - -Thu Oct 15 15:18:22 1992 Per Bothner (bothner@cygnus.com) - - * strsignal.c: Add appropriate 'const' to sys_siglist - extern declaration (if __STDC__). (Needed for Linux.) - * strsignal.c (strsignal): Add cast to remove const-ness. - -Fri Oct 9 03:22:55 1992 John Gilmore (gnu@cygnus.com) - - * Makefile.in (needed.awk, needed2.awk): Remove erroneous \'s - before "'s, diagnosed by BSD 4.4 awk. - -Thu Oct 8 15:25:12 1992 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in: create config.h and needed-list through $(CONFIG_H) - and $(NEEDED_LIST), to give some hooks for xiberty. - -Thu Oct 1 23:31:42 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * configure.in: use cpu-vendor-triple instead of nested cases - -Wed Sep 30 11:26:59 1992 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in, argv.c, basename.c, bcmp.c, bcopy.c, bzero.c, - concat.c, cplus-dem.c, fdmatch.c, getcwd.c, getopt.c, getopt1.c, - getpagesize.c, insque.c, memcmp.c, memcpy.c, memmove.c, memset.c, - obstack.c, sigsetmask.c, spaces.c, strchr.c, strerror.c, - strrchr.c, strsignal.c, strstr.c, vfork.c, vsprintf.c: - Convert from using GPL to LGPL. - -Sat Sep 26 04:01:30 1992 John Gilmore (gnu@cygnus.com) - - * Makefile.in (errors): Leave dummy.o and dummy around so that - we can see how the needed list was generated (it's sometimes wrong). - (mostlyclean): Remove them. - -Mon Sep 21 14:50:42 1992 Ian Lance Taylor (ian@cygnus.com) - - * getcwd.c: supply a default if MAXPATHLEN is not defined. - - * config/mh-irix4: set EXTRA_OFILES to alloca.o, from WRS. - -Wed Sep 9 12:41:48 1992 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in: Use XTRAFLAGS when compiling, so that xiberty works - when cross-compiling. - -Thu Sep 3 13:29:39 1992 K. Richard Pixley (rich@sendai.cygnus.com) - - * cplus-dem.c: (demangle_prefix): reduction in strength of strstr - as a time optimization. - - * cplus-dem.c (cplus_demangle): remove strpbrk test. Appears to - be more expensive than simply demangling. - - * cplus-dem.c (cplus_match): new function. - -Tue Sep 1 15:24:04 1992 Per Bothner (bothner@rtl.cygnus.com) - - * cplus-dem.c: #include <stdio.h>, to define NULL. - Define current_demangling_style. - -Sun Aug 30 17:58:19 1992 Per Bothner (bothner@rtl.cygnus.com) - - * cplus-dem.c: New file, moved from ../gdb. - * cplus-dem.c (set_cplus_marker_for_demangling): New exported - function, to avoid compiling in target-dependency for CPLUS_MARKER. - * cplus-dem.c (cplus_demangle): Allow demangling style option - to be passed as a parameter, but using the global variable - current_demangling_style as a default. - * Makefile.in: Update for cplus-dem.c - -Sat Aug 29 10:44:09 1992 Fred Fish (fnf@cygnus.com) - - * obstack.c: Merge in comment changes from FSF version. Now - matches the FSF version exactly. - -Fri Aug 28 18:39:08 1992 John Gilmore (gnu@cygnus.com) - - * obstack.c (CALL_FREEFUN): Can't use ?: with void values (at - least on losing DECstations!); use if-then-else instead. - -Wed Aug 19 14:40:34 1992 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in: always create installation directories. - -Mon Aug 10 17:33:40 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: clean up definition of CFILES, more comments - -Sat Aug 8 23:10:59 1992 Fred Fish (fnf@cygnus.com) - - * getopt.c (my_index): Make first arg const to match strchr, - which it sometimes is remapped to. - -Sat Aug 1 13:48:50 1992 Fred Fish (fnf@cygnus.com) - - * obstack.c (DEFAULT_ALIGNMENT): Update to match FSF version. - * obstack.c (_obstack_begin): Initialize use_extra_arg. - * obstack.c (_obstack_begin_1): New, from FSF version. - -Mon Jul 20 21:07:58 1992 Fred Fish (fnf@cygnus.com) - - * obstack.c (CALL_CHECKFUN, CALL_FREEFUN): Use use_extra_arg and - extra_arg. - * obstack.c (_obstack_begin): Remove area_id and flags arguments - (previously added for mmalloc support, interface has changed). - Also convert flags usage to use use_extra_arg and maybe_empty_object. - -Fri Jul 10 00:41:53 1992 Fred Fish (fnf@cygnus.com) - - * argv.c: Move expandargv inline and eliminate static variables. - Rewrite to always allocate in powers of two. Fix to return an - argv with a single null string arg if passed a null string. - -Fri Jul 3 20:27:29 1992 Fred Fish (fnf@cygnus.com) - - * random.c, sigsetmask.c, strerror.c, strsignal.c: Remove - "(void)" casts from function calls where the return value is - ignored, in accordance with GNU coding standards. - -Mon Jun 29 10:54:19 1992 Fred Fish (fnf at cygnus.com) - - * bcopy.c, strerror.c, strsignal.c: Lint. - -Thu Jun 25 09:18:41 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - * getopt.c: merge changes from make. - -Thu Jun 25 04:43:22 1992 John Gilmore (gnu at cygnus.com) - - * alloca.c: Incorporate fixes from gdb/alloca.c. - FIXME: Eventually move gdb's alloca configuration files here, - and remove gdb/alloca.c and its Makefile.in support. - -Tue Jun 23 21:56:30 1992 Fred Fish (fnf@cygnus.com) - - * dummy.c: Define NOTHING to /*nothing*/, change return type - of main to int and return zero. - * functions.def: Supply NOTHING as the fourth arg to macros - that don't have an explicit arg, to satisfy picky preprocessors. - -Wed Jun 17 18:13:58 1992 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: Clean up *clean rules, as per standards.texi. - -Tue Jun 16 16:11:59 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - * getopt.c, getopt1.c: merged largely gratuitous, mostly - whitespace diffs from other prep distributions. - -Mon Jun 15 12:25:46 1992 Fred Fish (fnf@cygnus.com) - - * config/mh-ncr3000 (INSTALL): Don't use /usr/ucb/install, - it is broken on ncr 3000's. - -Mon Jun 15 01:03:26 1992 John Gilmore (gnu at cygnus.com) - - * sigsetmask.c: Rewrite. Old one was very confused about its - arguments and result. New one can't do much, but at least knows - what it can't do, and it's good enough for GDB's use. - -Sun Jun 14 15:17:40 1992 Stu Grossman (grossman at cygnus.com) - - * functions.def: Use proper prototype for strtoul. - -Fri Jun 12 19:22:40 1992 John Gilmore (gnu at cygnus.com) - - * Makefile.in: Add random.c. - * config/mh-*: Use "true" rather than "echo >/dev/null" for ranlib. - * configure.in: update solaris2 config. - -Wed Jun 10 16:31:29 1992 Fred Fish (fnf@cygnus.com) - - * random.c: Add for random() and srandom(). - * functions.def: Add random - -Tue Jun 9 17:27:18 1992 Fred Fish (fnf@cygnus.com) - - * config/{mh-ncr3000, mh-sysv4}: Add definition for INSTALL - using /usr/ucb/install. - -Mon Jun 1 13:20:17 1992 Per Bothner (bothner@rtl.cygnus.com) - - * strerror.c: Kludge to guard against a conflict with - possible declaration of sys_errlist in errno.h. - -Sun May 31 15:07:47 1992 Mark Eichin (eichin at cygnus.com) - - * configure.in, config/mh-solaris: add solaris2 config support. - -Fri May 29 17:23:23 1992 Per Bothner (bothner@rtl.cygnus.com) - - * sigsetmask.c: #ifdef out sigsetmask if SIG_SETMASK - is not defined (should be defined in signal.h, says Posix.). - -Mon May 18 17:35:04 1992 K. Richard Pixley (rich@cygnus.com) - - * getopt.c: merged changes from make-3.62.11. - -Fri May 8 14:53:07 1992 K. Richard Pixley (rich@cygnus.com) - - * getopt.c: merged changes from bison-1.18. - -Tue May 5 11:51:40 1992 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: Don't have $(EXTRA_OFILES) depend on config.h, - since that introduces a circular dependency. - ($(EXTRA_OFILES) are used to build config.h.) - - * strtoul.c: Fixes to handle non-decimal bases better. - -Wed Apr 22 09:27:51 1992 Fred Fish (fnf@cygnus.com) - - * config/mh-ncr3000: Replace MINUS_G with CFLAGS. - * Makefile.dos: Finish MINUS_G eradication. - * Makefile.in (CFILES): Add strsignal.c. - * Makefile.in (REQUIRED_OFILES): Add strerror.o strsignal.o - * Makefile.in (needed-list): Split creation of errors file to - separate make target. - * Makefile.in (config.h, needed2.awk, errors): New targets. - * Makefile.in (clean): Split to multiple lines, add needed2.awk - and config.h. - * dummy.c (DEFFUNC, DEFVAR): Add defines and undefs. - * functions.def (strerror): Remove from optional list. - * functions.def (sys_nerr, sys_errlist, sys_siglist): DEFVAR's - * functions.def (strerror, psignal): DEFFUNC's - * strerror.c: Rewrite from scratch to use sys_errlist only if - available, add errno_max(), add strerrno(), add strtoerrno(), - add test driver. - * strsignal.c: New file, signal equivalent to strerror.c. - Uses sys_siglist if available, defines signo_max(), strsignal(), - strsigno(), strtosigno(), psignal(), and test driver. - -Mon Apr 20 20:49:32 1992 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in: do not print recursion line. - - * Makefile.in: allow CFLAGS to be passed in from command line. - Removed MINUS_G. Default CFLAGS to -g. - -Mon Apr 20 12:57:46 1992 Per Bothner (bothner@rtl.cygnus.com) - - * config/mh-aix: New. EXTRA_OFILES lists copysign.o, - so libg++ users don't have to be inconvenienced by a - libc.a bug (libc.a needs copysign, but doesn't define it!). - * configure.in: Use config/mh-aix. - * strtoul.c: Handle '-' as required by ANSI. - Clean up radix handling. - * strstr.c: Fix buggy algorithm. - * Makefile.in: Change so that ${EXTRA_OFILES} is - appended to needed-list (which is used by libg++). - -Fri Apr 10 22:51:41 1992 Fred Fish (fnf@cygnus.com) - - * configure.in: Recognize new ncr3000 config. - * config/mh-ncr3000: New config file. - -Wed Apr 1 23:31:43 1992 John Gilmore (gnu at cygnus.com) - - * argv.c, dummy.c: Lint. - -Tue Mar 31 18:46:44 1992 Fred Fish (fnf@cygnus.com) - - * config/mh-sysv4: New config file. - * configure.in (host_makefile_frag): Set to config/mh-sysv4 for - host_os == sysv4. - * getpagesize.c: For SVR4, use sysconf(_SC_PAGESIZE) to get - pagesize. - -Sun Mar 29 12:26:42 1992 John Gilmore (gnu at cygnus.com) - - * getopt.c: Lint. - -Fri Mar 27 08:32:55 1992 Fred Fish (fnf@cygnus.com) - - * functions.def (alloca): Fix return type and args to avoid - type clash with gcc's builtin alloca. - -Tue Mar 24 23:33:42 1992 K. Richard Pixley (rich@cygnus.com) - - * configure.in, config/mh-irix4: irix4 support. - - * Makefile.in, functions.def, alloca.c: added alloca. - -Tue Mar 24 17:34:46 1992 Stu Grossman (grossman at cygnus.com) - - * obstack.c (CALL_FREEFUN): Make it compile on DECstations. - -Thu Mar 19 13:57:42 1992 Fred Fish (fnf@cygnus.com) - - * argv.c: Fix various external function definitions to be - correct in an ANSI compilation environment. - -Sat Mar 14 17:28:17 1992 Fred Fish (fnf@cygnus.com) - - * obstack.c: Changes to support calling mmalloc functions, - which take an additional argument over malloc functions. - -Fri Mar 6 22:01:10 1992 K. Richard Pixley (rich@cygnus.com) - - * added check target. - -Thu Feb 27 22:19:39 1992 Per Bothner (bothner@cygnus.com) - - * argv.c: #include alloca-conf.h (needed by AIX). - -Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in, configure.in: removed traces of namesubdir, - -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced - copyrights to '92, changed some from Cygnus to FSF. - -Sat Feb 22 01:09:21 1992 Stu Grossman (grossman at cygnus.com) - - * argv.c: Check in Fred's version which fixes problems with - alloca(). - -Fri Feb 7 21:46:08 1992 Stu Grossman (grossman at cygnus.com) - - * makefile.dos: Remove NUL to keep patch from failing. - -Thu Jan 30 22:48:41 1992 Stu Grossman (grossman at cygnus.com) - - * getopt.c (_getopt_internal): Fix usage of enum has_arg. - -Mon Jan 20 18:53:23 1992 Stu Grossman (grossman at cygnus.com) - - * getopt.c, getopt1.c, ../include/getopt.h: Get latest versions. - -Sat Jan 18 16:53:01 1992 Fred Fish (fnf at cygnus.com) - - * argv.c: New file to build and destroy standard argument - vectors from a command string. - - * Makefile.in: Add argv.c and argv.o to appropriate macros. - -Fri Dec 20 12:12:57 1991 Fred Fish (fnf at cygnus.com) - - * configure.in: Change svr4 references to sysv4. - - * rindex.c: Declare return type of externally used function - strrchr(). - -Thu Dec 19 18:35:03 1991 John Gilmore (gnu at cygnus.com) - - * Makefile.in: Remove "***" in normal output, since Make produces - this on errors, and it's convenient to search for. - -Tue Dec 17 23:21:30 1991 Per Bothner (bothner at cygnus.com) - - * memcmp.c, memcpy.c, memmove.c, memset.c, strchr.c, strrchr.c: - New ANSI functions. The old non-ANSI functions (such as bcopy) - should be avoided. - * bcopy.c: Fix to correctly handle overlapping regions. - * index.c, rindex.c: Re-write in terms of strchr() and strrchr(). - * functions.def: Add the new functions. - * functions.def: Add 4th parameter to DEF macro, - an ansidecl.h-style prototype. - * dummy.c: Use expanded DEF macro to create a dummy function - call, with correct parameter types. (This avoids some - complaints from gcc about predefined builtins.) - - Move the functionality of config/mh-default into Makefile.in. - This avoid duplication, and simplifies things slightly. - * Makefile.in: Tweak so we don't need config/mh-default. - * README: Update. - * configure.in: No longer need config/mh-default. - * config/mh-default: Deleted. - * config/mh-sysv: Remove lines copied from old mh-default. - -Tue Dec 17 05:46:46 1991 John Gilmore (gnu at cygnus.com) - - * fdmatch.c (fdmatch): Don't compare st_rdev, which is for - 'mknod' device numbers. - -Mon Dec 16 12:25:34 1991 Fred Fish (fnf at cygnus.com) - - * fdmatch.c, Makefile.in: Add new function that takes two - open file descriptors and returns nonzero if they refer to - the same file, zero otherwise. (used in gdb) - -Wed Dec 11 17:40:39 1991 Steve Chamberlain (sac at rtl.cygnus.com) - From DJ: - * msdos.c: stub functions for dos. - * makefile.dos, configdj.bat: new. - * getopt.c: Don't include alloca-conf.h in a GO32 world. - - -Tue Dec 10 04:14:49 1991 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: infodir belongs in datadir. - -Fri Dec 6 23:26:45 1991 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: remove spaces following hyphens because bsd make - can't cope. added standards.text support. install using - INSTALL_DATA. - - * configure.in: remove commontargets as it is no longer a - recognized hook. - -Thu Dec 5 22:46:46 1991 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: idestdir and ddestdir go away. Added copyrights - and shift gpl to v2. Added ChangeLog if it didn't exist. docdir - and mandir now keyed off datadir by default. - -Fri Nov 22 19:15:29 1991 John Gilmore (gnu at cygnus.com) - - * Makefile.in: find-needed.awk does not fit in 14 chars. - - * Makefile.in: Suppress error checking when compiling the test - program, because Ultrix make/sh aborts there due to a bug. - -Fri Nov 22 12:23:17 1991 Per Bothner (bothner at cygnus.com) - - * Makefile.in: Re-did how EXTRA_OFILES is used to be more useful. - * README: Explained how the auto-configuration works, - and how to add new files and/or configurations. - -Fri Nov 22 09:45:23 1991 John Gilmore (gnu at cygnus.com) - - * strtoul.c: Avoid defining ULONG_MAX if already defined; - cast a const char * to char * for pedants. - - * getopt.c: Only define "const" after local include files get to, - and only if they haven't defined it. - -Thu Nov 21 16:58:53 1991 John Gilmore (gnu at cygnus.com) - - * getcwd.c (remove getwd.c): GNU code should call getcwd(). We - emulate it with getwd() if available. This avoids callers having - to find a MAXPATHLEN or PATH_MAX value from somewhere. - * Makefile.in, functions.def: getwd->getcwd. - * configure.in: Use generic case for every system. - * config/mh-{delta88,mach,rs6000,svr4}: Remove. - * config/mh-sysv: Use default handling, just add -DUSG. - -Thu Nov 14 10:58:05 1991 Per Bothner (bothner at cygnus.com) - - * Makefile.in, config/mh-default: Re-do make magic - so that for the default ("automatic") mode we only - compile the files we actually need. Do this using - a recursive make: The top-level generates the list - of needed files (loosely, the ones missing in libc), - and then passes that list to the recursive make. - * config/mh-mach: Remove obsolete STRERROR-{C,O} macros. - -Tue Nov 12 19:10:57 1991 John Gilmore (gnu at cygnus.com) - - RS/6000 host support (grumble). - - * configure.in: Build alloca-conf.h file from alloca-norm.h - (everything else) or alloca-botch.h (rs/6000). - * Makefile.in: Include . on the include path. - * getopt.c: Use alloca-conf.h. - * alloca-norm.h: How to declare alloca on reasonable machines. - * alloca-botch.h: How to declare alloca on braindead machines. - -Tue Nov 12 09:21:48 1991 Fred Fish (fnf at cygnus.com) - - * concat.c : New file, like concat() in gdb but can take a - variable number of arguments rather than fixed at 3 args. For - now, client applications must supply an xmalloc(), which is a - front end function to malloc() that deals with out-of-memory - conditions. - - * Makefile.in: Add concat.c and concat.o to appropriate macros. - -Sat Nov 9 13:29:59 1991 Fred Fish (fnf at cygnus.com) - - * config/mh-svr4: Add sigsetmask to list of required functions. - -Sun Nov 3 11:57:56 1991 Per Bothner (bothner at cygnus.com) - - * vsprintf.c: New file. - * functions.def, Makefile.in: Add vsprintf. - -Sun Oct 27 16:31:22 1991 John Gilmore (gnu at cygnus.com) - - * configure.in, config/mh-rs6000: Add rs/6000 host support. - * Makefile.in: Compile with debug info. - -Fri Oct 25 17:01:12 1991 Per Bothner (bothner at cygnus.com) - - * Makefile.in, configure.in, and new files: dummy.c, functions.def, - config/mf-default: Added a default configuration mode, - which includes into libiberty.a functions that are "missing" in libc. - * strdup.c, vprintf.c, vfprintf.c: New files. - -Thu Oct 24 02:29:26 1991 Fred Fish (fnf at cygnus.com) - - * config/hmake-svr4: New file. - - * config/hmake-sysv: Add HOST_CFILES and HOST_OFILES. - - * basename.c, bcmp.c, bcopy.c, bzero.c, getpagesize.c getwd.c, - index.c, insque.c, rindex.c, spaces.c, strstr.c, vfork.c: New - files containing either portable C versions or emulations using - native library calls. - - * strerror.c: Add copyright, internal documentation, etc. - - * strtol.c: Replace hardwired hex constants with some more - portable macros. Remove illegal (according to gcc) cast. - - * strtoul.c: Replace hardwired hex constant with more portable - macro. - - * Makefile.in: Move TARGETLIB and CFLAGS where makefile fragments - can override them. Add new source and object file names to CFILES - and OFILES respectively. - - * configure.in: Add support for SVR4 makefile fragments. - -Tue Oct 22 19:00:23 1991 Steve Chamberlain (steve at cygnus.com) - - * Makefile.in: Move RANLIB, AR and AR_FLAGS to where they can be - over-ridden by config/hmake-* - * configure.in: added m88kcvs to sysv list - -Fri Oct 4 01:29:08 1991 John Gilmore (gnu at cygnus.com) - - * Makefile.in: Most hosts need strerror, but one or two don't, - and they override these definitions in the host-dependent makefile - fragment. - * config/hmake-mach: The odd man out on strerror -- it's supplied. - * strerror.c: New file. - - * strtol.c, strtoul.c: Add strtol to libiberty, since Mach lacks - it and bfd uses it. - * configure.in, Makefile.in, config/hmake-mach: Only configure - strtol & strotoul in on Mach. - -Tue Sep 3 06:36:23 1991 John Gilmore (gnu at cygint.cygnus.com) - - * obstack.c: Merge with latest FSF version. - - -Local Variables: -version-control: never -End: diff --git a/gnu/egcs/libiberty/Makefile.bsd-wrapper b/gnu/egcs/libiberty/Makefile.bsd-wrapper deleted file mode 100644 index 55a1c5bf089..00000000000 --- a/gnu/egcs/libiberty/Makefile.bsd-wrapper +++ /dev/null @@ -1,38 +0,0 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.12 2002/12/04 19:43:13 millert Exp $ - -LIB= iberty -CPPFLAGS+= -DHAVE_CONFIG_H -I$(.CURDIR) -I$(.CURDIR)/../include -I$(.OBJDIR) - -# XXX -- GNUism -# As we need to fill variables with contents of dynamically created files -# we must first see to that they are really generated. This is a hack that -# ensures this. The echo at the end is because make doesn't like command -# substitutions to not generate output. -.ifmake !obj && !clean && !cleandir -PREREQ!= test ! -f $(.OBJDIR)/needed-list && \ - (cd $(.CURDIR); \ - $(MAKE) -f Makefile.bsd-wrapper1 needed-list); \ - echo 'Prerequisites made' -HOST_FILES!= cat $(.OBJDIR)/needed-list -.endif - -SRCS= argv.c choose-temp.c concat.c cplus-dem.c dyn-string.c \ - fdmatch.c getopt.c getopt1.c getpwd.c getruntime.c \ - hashtab.c hex.c floatformat.c objalloc.c obstack.c \ - pexecute.c spaces.c splay-tree.c strerror.c strsignal.c \ - xatexit.c xexit.c xmalloc.c xstrerror.c xstrdup.c \ - $(HOST_FILES) - -# choose-temp.c fnmatch.c objalloc.c pexecute.c xstrdup.c \ -# basename.c vasprintf.c - -# XXX -- These files are generated during the PREREQ variable assignment. -CLEANFILES+= config.h config.status needed-list - -# XXX -- Why are these not removed by the generated Makefile? -CLEANFILES+= insque.o insque.go insque.po insque.so - -# and more -CLEANFILES+=Makefile config.cache config.log stamp-h xhost-mkfrag testsuite/Makefile - -.include <bsd.lib.mk> diff --git a/gnu/egcs/libiberty/Makefile.bsd-wrapper1 b/gnu/egcs/libiberty/Makefile.bsd-wrapper1 deleted file mode 100644 index 9d72477b2e3..00000000000 --- a/gnu/egcs/libiberty/Makefile.bsd-wrapper1 +++ /dev/null @@ -1,17 +0,0 @@ -# $OpenBSD: Makefile.bsd-wrapper1,v 1.1 1999/05/26 15:47:00 espie Exp $ -# -# XXX -- GNUism -# This file's only purpose to help isolate -# the funky GNU build mechanism! -# -CPPFLAGS+= -I$(.CURDIR) -I$(.CURDIR)/../include -I$(.OBJDIR) - -needed-list: config.status - ${MAKE} ${GNUCFLAGS} CC=${CC} needed-list - -config.status: Makefile.in configure - PATH="/bin:/usr/bin:/sbin:/usr/sbin" \ - INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \ - /bin/sh ${.CURDIR}/configure \ - --prefix=/usr --with-local-prefix=/usr ${CF} \ - && touch config.status diff --git a/gnu/egcs/libiberty/Makefile.in b/gnu/egcs/libiberty/Makefile.in deleted file mode 100644 index 9aa57f06d4b..00000000000 --- a/gnu/egcs/libiberty/Makefile.in +++ /dev/null @@ -1,288 +0,0 @@ -# -# Makefile -# Copyright (C) 1990, 91 - 99, 2000 -# Free Software Foundation -# -# This file is part of the libiberty library. -# Libiberty is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# Libiberty is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with libiberty; see the file COPYING.LIB. If not, -# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# - -# This file was written by K. Richard Pixley <rich@cygnus.com>. - -# -# Makefile for libiberty directory -# - -srcdir = @srcdir@ -VPATH = @srcdir@ - -prefix = @prefix@ - -exec_prefix = @exec_prefix@ -bindir = @bindir@ -libdir = @libdir@ - -SHELL = @SHELL@ - -# Multilib support variables. -MULTISRCTOP = -MULTIBUILDTOP = -MULTIDIRS = -MULTISUBDIR = -MULTIDO = true -MULTICLEAN = true - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -AR = @AR@ -AR_FLAGS = rc - -CC = @CC@ -CFLAGS = @CFLAGS@ -LIBCFLAGS = $(CFLAGS) -RANLIB = @RANLIB@ - -PICFLAG = - -MAKEOVERRIDES = - -TARGETLIB = libiberty.a - -LIBOBJS = @LIBOBJS@ -ALLOCA = @ALLOCA@ - -# A configuration can specify extra .o files that should be included, -# even if they are in libc. (Perhaps the libc version is buggy.) -EXTRA_OFILES = - -# Flags to pass to a recursive make. -FLAGS_TO_PASS = \ - "AR=$(AR)" \ - "AR_FLAGS=$(AR_FLAGS)" \ - "CC=$(CC)" \ - "CFLAGS=$(CFLAGS)" \ - "LIBCFLAGS=$(LIBCFLAGS)" \ - "EXTRA_OFILES=$(EXTRA_OFILES)" \ - "HDEFINES=$(HDEFINES)" \ - "INSTALL=$(INSTALL)" \ - "INSTALL_DATA=$(INSTALL_DATA)" \ - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ - "LDFLAGS=$(LDFLAGS)" \ - "LOADLIBES=$(LOADLIBES)" \ - "RANLIB=$(RANLIB)" \ - "SHELL=$(SHELL)" \ - "prefix=$(prefix)" \ - "exec_prefix=$(exec_prefix)" \ - "libdir=$(libdir)" \ - "libsubdir=$(libsubdir)" \ - "tooldir=$(tooldir)" - -# Subdirectories to recurse into. We need to override this during cleaning -SUBDIRS = testsuite - -all: stamp-picdir $(TARGETLIB) needed-list required-list all-subdir - @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all - -.PHONY: check installcheck -check: check-subdir -installcheck: installcheck-subdir - -@host_makefile_frag@ - -INCDIR=$(srcdir)/$(MULTISRCTOP)../include - -COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@ -.c.o: - test x"$(enable_shared)" != xyes || \ - $(COMPILE.c) $(PICFLAG) $< -o pic/$@ - $(COMPILE.c) $< - -info: info-subdir -install-info: install-info-subdir -clean-info: clean-info-subdir -dvi: dvi-subdir - -# Include files that are in this directory. -HFILES = alloca-conf.h - -# NOTE: If you add new files to the library, add them to this list -# (alphabetical), and add them to REQUIRED_OFILES or funcs in -# configure.in. -CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \ - bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c fdmatch.c \ - fnmatch.c getcwd.c getpwd.c getopt.c getopt1.c getpagesize.c \ - getruntime.c floatformat.c hashtab.c hex.c index.c insque.c memchr.c \ - memcmp.c memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \ - partition.c pexecute.c putenv.c random.c rename.c rindex.c \ - setenv.c sigsetmask.c spaces.c splay-tree.c strcasecmp.c \ - strncasecmp.c strchr.c strdup.c strerror.c strrchr.c \ - strsignal.c strstr.c strtod.c strtol.c strtoul.c tmpnam.c \ - vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c waitpid.c \ - xatexit.c xexit.c xmalloc.c xmemdup.c xstrdup.c xstrerror.c - -# These are always included in the library. -REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o \ - fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o \ - hex.o floatformat.o objalloc.o obstack.o partition.o pexecute.o spaces.o \ - splay-tree.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o \ - xmemdup.o xstrdup.o xstrerror.o - -$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA) - rm -f $(TARGETLIB) - $(AR) $(AR_FLAGS) $(TARGETLIB) \ - $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA) - $(RANLIB) $(TARGETLIB) - -INSTALL_DEST = @INSTALL_DEST@ -install: install_to_$(INSTALL_DEST) install-subdir - -install_to_libdir: all - $(INSTALL_DATA) $(TARGETLIB) $(libdir)$(MULTISUBDIR)/$(TARGETLIB)n - ( cd $(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) - mv -f $(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(libdir)$(MULTISUBDIR)/$(TARGETLIB) - @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install - -install_to_tooldir: all - $(INSTALL_DATA) $(TARGETLIB) $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n - ( cd $(tooldir)/lib$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n ) - mv -f $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)n $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB) - @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install - -# needed-list is used by libstdc++. NEEDED is the list of functions -# to include there. Do not add anything LGPL to this list; libstdc++ -# can't use anything encumbering. -NEEDED = atexit calloc memchr memcmp memcpy memmove memset rename strchr \ - strerror strrchr strstr strtol strtoul tmpnam vfprintf vprintf \ - vfork waitpid bcmp bcopy bzero -needed-list: Makefile - rm -f needed-list; touch needed-list; \ - for f in $(NEEDED); do \ - for g in $(LIBOBJS) $(EXTRA_OFILES); do \ - case "$$g" in \ - *$$f*) echo $$g >> needed-list ;; \ - esac; \ - done; \ - done - -# required-list was used when building a shared bfd/opcodes/libiberty -# library. I don't know if it used by anything currently. -required-list: Makefile - echo $(REQUIRED_OFILES) > required-list - -stamp-picdir: - if [ x"$(enable_shared)" = xyes ] && [ ! -d pic ]; then \ - mkdir pic; \ - else true; fi - touch stamp-picdir - -.PHONY: all etags tags ls clean stage1 stage2 - -etags tags: TAGS etags-subdir - -TAGS: $(CFILES) $(HFILES) - etags `for i in $(HFILES) $(CFILES); do echo $(srcdir)/$$i ; done` - -# The standalone demangler (c++filt) has been moved to binutils. -demangle: - @echo "The standalone demangler, now named c++filt, is now" - @echo "a part of binutils." - @false - -ls: - @echo Makefile $(HFILES) $(CFILES) - -# Need to deal with profiled libraries, too. - -# Cleaning has to be done carefully to ensure that we don't clean our SUBDIRS -# multiple times, hence our explicit recursion with an empty SUBDIRS. -mostlyclean: mostlyclean-subdir - rm -rf *.o pic core errs \#* *.E a.out - rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-* - rm -f $(CONFIG_H) $(NEEDED_LIST) stamp-picdir - @$(MULTICLEAN) multi-clean DO=mostlyclean -clean: clean-subdir - $(MAKE) SUBDIRS="" mostlyclean - rm -f *.a required-list tmpmulti.out - @$(MULTICLEAN) multi-clean DO=clean -distclean: distclean-subdir - $(MAKE) SUBDIRS="" clean - @$(MULTICLEAN) multi-clean DO=distclean - rm -f *~ Makefile config.status xhost-mkfrag TAGS multilib.out - rm -f config.log -maintainer-clean realclean: maintainer-clean-subdir - $(MAKE) SUBDIRS="" distclean - -force: - -Makefile: $(srcdir)/Makefile.in config.status - CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status - -config.h: stamp-h ; @true -stamp-h: config.in config.status - CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status - -config.status: $(srcdir)/configure $(srcdir)/config.table - $(SHELL) ./config.status --recheck - - -all-subdir check-subdir installcheck-subdir info-subdir \ -install-info-subdir clean-info-subdir dvi-subdir install-subdir \ -etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \ -maintainer-clean-subdir: - @target=`echo $@ | sed -e 's/-subdir//'`; \ - for dir in . $(SUBDIRS) ; do \ - test $$dir = . || (cd $$dir && $(MAKE) $$target) || exit 1; \ - done - -$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA): stamp-picdir - -alloca.o: config.h -atexit.o: config.h -argv.o: config.h alloca-conf.h $(INCDIR)/libiberty.h -basename.o: $(INCDIR)/libiberty.h -choose-temp.o: config.h -clock.o: config.h -concat.o: $(INCDIR)/libiberty.h -cplus-dem.o: config.h $(INCDIR)/demangle.h -fdmatch.o: $(INCDIR)/libiberty.h -fnmatch.o: config.h $(INCDIR)/fnmatch.h -getcwd.o: config.h -getopt.o: config.h $(INCDIR)/getopt.h -getopt1.o: config.h $(INCDIR)/getopt.h -getpagesize.o: config.h -getpwd.o: config.h $(INCDIR)/libiberty.h -getruntime.o: config.h $(INCDIR)/libiberty.h -hex.o: $(INCDIR)/libiberty.h -floatformat.o: $(INCDIR)/floatformat.h -mkstemps.o: config.h -objalloc.o: $(INCDIR)/objalloc.h -obstack.o: config.h $(INCDIR)/obstack.h -partition.o: config.h $(INCDIR)/partition.h -pexecute.o: config.h $(INCDIR)/libiberty.h -setenv.o: config.h -spaces.o: $(INCDIR)/libiberty.h -splay-tree.o: config.h $(INCDIR)/libiberty.h $(INCDIR)/splay-tree.h $(INCDIR)/ansidecl.h -strerror.o: config.h $(INCDIR)/libiberty.h -strsignal.o: config.h $(INCDIR)/libiberty.h -xatexit.o: $(INCDIR)/libiberty.h -xexit.o: $(INCDIR)/libiberty.h -xmalloc.o: $(INCDIR)/libiberty.h -xmemdup.o: config.h $(INCDIR)/libiberty.h -xstrdup.o: config.h $(INCDIR)/libiberty.h -xstrerror.o: config.h $(INCDIR)/libiberty.h -hashtab.o: config.h $(INCDIR)/libiberty.h $(INCDIR)/hashtab.h $(INCDIR)/ansidecl.h diff --git a/gnu/egcs/libiberty/README b/gnu/egcs/libiberty/README deleted file mode 100644 index 9f5226a6b1d..00000000000 --- a/gnu/egcs/libiberty/README +++ /dev/null @@ -1,65 +0,0 @@ -This directory contains the -liberty library of free software. -It is a collection of subroutines used by various GNU programs. -Current members include: - - getopt -- get options from command line - obstack -- stacks of arbitrarily-sized objects - strerror -- error message strings corresponding to errno - strtol -- string-to-long conversion - strtoul -- string-to-unsigned-long conversion - -We expect many of the GNU subroutines that are floating around to -eventually arrive here. - -The library must be configured from the top source directory. Don't -try to run configure in this directory. Follow the configuration -instructions in ../README. - -Please report bugs and fixes to "bug-gnu-utils@prep.ai.mit.edu". Thank you. - -ADDING A NEW FILE -================= - -There are two sets of files: Those that are "required" will be -included in the library for all configurations, while those -that are "optional" will be included in the library only if "needed." - -To add a new required file, edit Makefile to add the source file -name to CFILES and the object file to REQUIRED_OFILES. - -To add a new optional file, it must provide a single function, and the -name of the function must be the same as the name of the file. - - * Add the source file name to CFILES. - - * Add the function to name to the funcs shell variable in - configure.in. - - * Add the function to the AC_CHECK_FUNCS lists just after the - setting of the funcs shell variable. These AC_CHECK_FUNCS calls - are never executed; they are there to make autoheader work - better. - - * Consider the special cases of building libiberty; as of this - writing, the special cases are newlib and VxWorks. If a - particular special case provides the function, you do not need - to do anything. If it does not provide the function, add the - object file to LIBOBJS, and add the function name to the case - controlling whether to define HAVE_func. - -The optional file you've added (e.g. getcwd.c) should compile and work -on all hosts where it is needed. It does not have to work or even -compile on hosts where it is not needed. - -ADDING A NEW CONFIGURATION -========================== - -On most hosts you should be able to use the scheme for automatically -figuring out which files are needed. In that case, you probably -don't need a special Makefile stub for that configuration. - -If the fully automatic scheme doesn't work, you may be able to get -by with defining EXTRA_OFILES in your Makefile stub. This is -a list of object file names that should be treated as required -for this configuration - they will be included in libiberty.a, -regardless of whatever might be in the C library. diff --git a/gnu/egcs/libiberty/acconfig.h b/gnu/egcs/libiberty/acconfig.h deleted file mode 100644 index f7c599df7ac..00000000000 --- a/gnu/egcs/libiberty/acconfig.h +++ /dev/null @@ -1,11 +0,0 @@ -/* Define if you have the sys_errlist variable. */ -#undef HAVE_SYS_ERRLIST - -/* Define if you have the sys_nerr variable. */ -#undef HAVE_SYS_NERR - -/* Define if you have the sys_siglist variable. */ -#undef HAVE_SYS_SIGLIST - -/* Define if you have the strerror function. */ -#undef HAVE_STRERROR diff --git a/gnu/egcs/libiberty/aclocal.m4 b/gnu/egcs/libiberty/aclocal.m4 deleted file mode 100644 index c5628352773..00000000000 --- a/gnu/egcs/libiberty/aclocal.m4 +++ /dev/null @@ -1,136 +0,0 @@ -dnl See whether strncmp reads past the end of its string parameters. -dnl On some versions of SunOS4 at least, strncmp reads a word at a time -dnl but erroneously reads past the end of strings. This can cause -dnl a SEGV in some cases. -AC_DEFUN(libiberty_AC_FUNC_STRNCMP, -[AC_REQUIRE([AC_FUNC_MMAP]) -AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works, -[AC_TRY_RUN([ -/* Test by Jim Wilson and Kaveh Ghazi. - Check whether strncmp reads past the end of its string parameters. */ -#include <sys/types.h> - -#ifdef HAVE_FCNTL_H -#include <fcntl.h> -#endif - -#ifdef HAVE_SYS_MMAN_H -#include <sys/mman.h> -#endif - -#ifndef MAP_ANON -#ifdef MAP_ANONYMOUS -#define MAP_ANON MAP_ANONYMOUS -#else -#define MAP_ANON MAP_FILE -#endif -#endif - -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif - -#define MAP_LEN 0x10000 - -main () -{ -#if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE) - char *p; - int dev_zero; - - dev_zero = open ("/dev/zero", O_RDONLY); - if (dev_zero < 0) - exit (1); - - p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE, - MAP_ANON|MAP_PRIVATE, dev_zero, 0); - if (p == (char *)-1) - exit (2); - else - { - char *string = "__si_type_info"; - char *q = (char *) p + MAP_LEN - strlen (string) - 2; - char *r = (char *) p + 0xe; - - strcpy (q, string); - strcpy (r, string); - strncmp (r, q, 14); - } -#endif /* HAVE_MMAP || HAVE_MMAP_ANYWHERE */ - exit (0); -} -], ac_cv_func_strncmp_works=yes, ac_cv_func_strncmp_works=no, - ac_cv_func_strncmp_works=no) -rm -f core core.* *.core]) -if test $ac_cv_func_strncmp_works = no ; then - LIBOBJS="$LIBOBJS strncmp.o" -fi -]) - -dnl See if errno must be declared even when <errno.h> is included. -AC_DEFUN(libiberty_AC_DECLARE_ERRNO, -[AC_CACHE_CHECK(whether errno must be declared, libiberty_cv_declare_errno, -[AC_TRY_COMPILE( -[#include <errno.h>], -[int x = errno;], -libiberty_cv_declare_errno=no, -libiberty_cv_declare_errno=yes)]) -if test $libiberty_cv_declare_errno = yes -then AC_DEFINE(NEED_DECLARATION_ERRNO, 1, - [Define if errno must be declared even when <errno.h> is included.]) -fi -]) - -# FIXME: We temporarily define our own version of AC_PROG_CC. This is -# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -# are probably using a cross compiler, which will not be able to fully -# link an executable. This should really be fixed in autoconf -# itself. - -AC_DEFUN(LIB_AC_PROG_CC, -[AC_BEFORE([$0], [AC_PROG_CPP])dnl -AC_PROVIDE([AC_PROG_CC]) -AC_CHECK_PROG(CC, gcc, gcc) -if test -z "$CC"; then - AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) - test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -fi - -AC_PROG_CC_GNU - -if test $ac_cv_prog_gcc = yes; then - GCC=yes - ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic' -dnl Check whether -g works, even if CFLAGS is set, in case the package -dnl plays around with CFLAGS (such as to build both debugging and -dnl normal versions of a library), tasteless as that idea is. - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - AC_PROG_CC_G - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-O2" - fi -else - GCC= - ac_libiberty_warn_cflags= - test "${CFLAGS+set}" = set || CFLAGS="-g" -fi -AC_SUBST(ac_libiberty_warn_cflags) -]) - -# Work around a bug in autoheader. This can go away when we switch to -# autoconf >2.50. The use of define instead of AC_DEFUN is -# deliberate. -define(AC_DEFINE_NOAUTOHEADER, -[cat >> confdefs.h <<\EOF -[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1) -EOF -]) diff --git a/gnu/egcs/libiberty/alloca-conf.h b/gnu/egcs/libiberty/alloca-conf.h deleted file mode 100644 index 4eb87d3cfa4..00000000000 --- a/gnu/egcs/libiberty/alloca-conf.h +++ /dev/null @@ -1,24 +0,0 @@ -#include "config.h" - -#ifdef __GNUC__ -# ifndef alloca -# define alloca __builtin_alloca -# endif -#else /* ! defined (__GNUC__) */ -# ifdef _AIX - #pragma alloca -# else -# ifdef HAVE_ALLOCA_H -# include <alloca.h> -# else /* ! defined (HAVE_ALLOCA_H) */ -# ifdef __STDC__ -extern PTR alloca (size_t); -# else /* ! defined (__STDC__) */ -extern PTR alloca (); -# endif /* ! defined (__STDC__) */ -# endif /* ! defined (HAVE_ALLOCA_H) */ -# ifdef _WIN32 -# include <malloc.h> -# endif -# endif /* ! defined (_AIX) */ -#endif /* ! defined (__GNUC__) */ diff --git a/gnu/egcs/libiberty/alloca.c b/gnu/egcs/libiberty/alloca.c deleted file mode 100644 index 0f8a21511db..00000000000 --- a/gnu/egcs/libiberty/alloca.c +++ /dev/null @@ -1,505 +0,0 @@ -/* alloca.c -- allocate automatically reclaimed memory - (Mostly) portable public-domain implementation -- D A Gwyn - - This implementation of the PWB library alloca function, - which is used to allocate space off the run-time stack so - that it is automatically reclaimed upon procedure exit, - was inspired by discussions with J. Q. Johnson of Cornell. - J.Otto Tennant <jot@cray.com> contributed the Cray support. - - There are some preprocessor constants that can - be defined when compiling for your specific system, for - improved efficiency; however, the defaults should be okay. - - The general concept of this implementation is to keep - track of all alloca-allocated blocks, and reclaim any - that are found to be deeper in the stack than the current - invocation. This heuristic does not reclaim storage as - soon as it becomes invalid, but it will do so eventually. - - As a special case, alloca(0) reclaims storage without - allocating any. It is a good idea to use alloca(0) in - your main control loop, etc. to force garbage collection. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#ifdef emacs -#include "blockinput.h" -#endif - -/* If compiling with GCC 2, this file's not needed. Except of course if - the C alloca is explicitly requested. */ -#if defined (USE_C_ALLOCA) || !defined (__GNUC__) || __GNUC__ < 2 - -/* If someone has defined alloca as a macro, - there must be some other way alloca is supposed to work. */ -#ifndef alloca - -#ifdef emacs -#ifdef static -/* actually, only want this if static is defined as "" - -- this is for usg, in which emacs must undefine static - in order to make unexec workable - */ -#ifndef STACK_DIRECTION -you -lose --- must know STACK_DIRECTION at compile-time -#endif /* STACK_DIRECTION undefined */ -#endif /* static */ -#endif /* emacs */ - -/* If your stack is a linked list of frames, you have to - provide an "address metric" ADDRESS_FUNCTION macro. */ - -#if defined (CRAY) && defined (CRAY_STACKSEG_END) -long i00afunc (); -#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) -#else -#define ADDRESS_FUNCTION(arg) &(arg) -#endif - -#if __STDC__ -typedef void *pointer; -#else -typedef char *pointer; -#endif - -#ifndef NULL -#define NULL 0 -#endif - -/* Different portions of Emacs need to call different versions of - malloc. The Emacs executable needs alloca to call xmalloc, because - ordinary malloc isn't protected from input signals. On the other - hand, the utilities in lib-src need alloca to call malloc; some of - them are very simple, and don't have an xmalloc routine. - - Non-Emacs programs expect this to call use xmalloc. - - Callers below should use malloc. */ - -#ifndef emacs -#define malloc xmalloc -#endif -extern pointer malloc (); - -/* Define STACK_DIRECTION if you know the direction of stack - growth for your system; otherwise it will be automatically - deduced at run-time. - - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ - -#ifndef STACK_DIRECTION -#define STACK_DIRECTION 0 /* Direction unknown. */ -#endif - -#if STACK_DIRECTION != 0 - -#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ - -#else /* STACK_DIRECTION == 0; need run-time code. */ - -static int stack_dir; /* 1 or -1 once known. */ -#define STACK_DIR stack_dir - -static void -find_stack_direction () -{ - static char *addr = NULL; /* Address of first `dummy', once known. */ - auto char dummy; /* To get stack address. */ - - if (addr == NULL) - { /* Initial entry. */ - addr = ADDRESS_FUNCTION (dummy); - - find_stack_direction (); /* Recurse once. */ - } - else - { - /* Second entry. */ - if (ADDRESS_FUNCTION (dummy) > addr) - stack_dir = 1; /* Stack grew upward. */ - else - stack_dir = -1; /* Stack grew downward. */ - } -} - -#endif /* STACK_DIRECTION == 0 */ - -/* An "alloca header" is used to: - (a) chain together all alloca'ed blocks; - (b) keep track of stack depth. - - It is very important that sizeof(header) agree with malloc - alignment chunk size. The following default should work okay. */ - -#ifndef ALIGN_SIZE -#define ALIGN_SIZE sizeof(double) -#endif - -typedef union hdr -{ - char align[ALIGN_SIZE]; /* To force sizeof(header). */ - struct - { - union hdr *next; /* For chaining headers. */ - char *deep; /* For stack depth measure. */ - } h; -} header; - -static header *last_alloca_header = NULL; /* -> last alloca header. */ - -/* Return a pointer to at least SIZE bytes of storage, - which will be automatically reclaimed upon exit from - the procedure that called alloca. Originally, this space - was supposed to be taken from the current stack frame of the - caller, but that method cannot be made to work for some - implementations of C, for example under Gould's UTX/32. */ - -pointer -alloca (size) - unsigned size; -{ - auto char probe; /* Probes stack depth: */ - register char *depth = ADDRESS_FUNCTION (probe); - -#if STACK_DIRECTION == 0 - if (STACK_DIR == 0) /* Unknown growth direction. */ - find_stack_direction (); -#endif - - /* Reclaim garbage, defined as all alloca'd storage that - was allocated from deeper in the stack than currently. */ - - { - register header *hp; /* Traverses linked list. */ - -#ifdef emacs - BLOCK_INPUT; -#endif - - for (hp = last_alloca_header; hp != NULL;) - if ((STACK_DIR > 0 && hp->h.deep > depth) - || (STACK_DIR < 0 && hp->h.deep < depth)) - { - register header *np = hp->h.next; - - free ((pointer) hp); /* Collect garbage. */ - - hp = np; /* -> next header. */ - } - else - break; /* Rest are not deeper. */ - - last_alloca_header = hp; /* -> last valid storage. */ - -#ifdef emacs - UNBLOCK_INPUT; -#endif - } - - if (size == 0) - return NULL; /* No allocation required. */ - - /* Allocate combined header + user data storage. */ - - { - register pointer new = malloc (sizeof (header) + size); - /* Address of header. */ - - if (new == 0) - abort(); - - ((header *) new)->h.next = last_alloca_header; - ((header *) new)->h.deep = depth; - - last_alloca_header = (header *) new; - - /* User storage begins just after header. */ - - return (pointer) ((char *) new + sizeof (header)); - } -} - -#if defined (CRAY) && defined (CRAY_STACKSEG_END) - -#ifdef DEBUG_I00AFUNC -#include <stdio.h> -#endif - -#ifndef CRAY_STACK -#define CRAY_STACK -#ifndef CRAY2 -/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ -struct stack_control_header - { - long shgrow:32; /* Number of times stack has grown. */ - long shaseg:32; /* Size of increments to stack. */ - long shhwm:32; /* High water mark of stack. */ - long shsize:32; /* Current size of stack (all segments). */ - }; - -/* The stack segment linkage control information occurs at - the high-address end of a stack segment. (The stack - grows from low addresses to high addresses.) The initial - part of the stack segment linkage control information is - 0200 (octal) words. This provides for register storage - for the routine which overflows the stack. */ - -struct stack_segment_linkage - { - long ss[0200]; /* 0200 overflow words. */ - long sssize:32; /* Number of words in this segment. */ - long ssbase:32; /* Offset to stack base. */ - long:32; - long sspseg:32; /* Offset to linkage control of previous - segment of stack. */ - long:32; - long sstcpt:32; /* Pointer to task common address block. */ - long sscsnm; /* Private control structure number for - microtasking. */ - long ssusr1; /* Reserved for user. */ - long ssusr2; /* Reserved for user. */ - long sstpid; /* Process ID for pid based multi-tasking. */ - long ssgvup; /* Pointer to multitasking thread giveup. */ - long sscray[7]; /* Reserved for Cray Research. */ - long ssa0; - long ssa1; - long ssa2; - long ssa3; - long ssa4; - long ssa5; - long ssa6; - long ssa7; - long sss0; - long sss1; - long sss2; - long sss3; - long sss4; - long sss5; - long sss6; - long sss7; - }; - -#else /* CRAY2 */ -/* The following structure defines the vector of words - returned by the STKSTAT library routine. */ -struct stk_stat - { - long now; /* Current total stack size. */ - long maxc; /* Amount of contiguous space which would - be required to satisfy the maximum - stack demand to date. */ - long high_water; /* Stack high-water mark. */ - long overflows; /* Number of stack overflow ($STKOFEN) calls. */ - long hits; /* Number of internal buffer hits. */ - long extends; /* Number of block extensions. */ - long stko_mallocs; /* Block allocations by $STKOFEN. */ - long underflows; /* Number of stack underflow calls ($STKRETN). */ - long stko_free; /* Number of deallocations by $STKRETN. */ - long stkm_free; /* Number of deallocations by $STKMRET. */ - long segments; /* Current number of stack segments. */ - long maxs; /* Maximum number of stack segments so far. */ - long pad_size; /* Stack pad size. */ - long current_address; /* Current stack segment address. */ - long current_size; /* Current stack segment size. This - number is actually corrupted by STKSTAT to - include the fifteen word trailer area. */ - long initial_address; /* Address of initial segment. */ - long initial_size; /* Size of initial segment. */ - }; - -/* The following structure describes the data structure which trails - any stack segment. I think that the description in 'asdef' is - out of date. I only describe the parts that I am sure about. */ - -struct stk_trailer - { - long this_address; /* Address of this block. */ - long this_size; /* Size of this block (does not include - this trailer). */ - long unknown2; - long unknown3; - long link; /* Address of trailer block of previous - segment. */ - long unknown5; - long unknown6; - long unknown7; - long unknown8; - long unknown9; - long unknown10; - long unknown11; - long unknown12; - long unknown13; - long unknown14; - }; - -#endif /* CRAY2 */ -#endif /* not CRAY_STACK */ - -#ifdef CRAY2 -/* Determine a "stack measure" for an arbitrary ADDRESS. - I doubt that "lint" will like this much. */ - -static long -i00afunc (long *address) -{ - struct stk_stat status; - struct stk_trailer *trailer; - long *block, size; - long result = 0; - - /* We want to iterate through all of the segments. The first - step is to get the stack status structure. We could do this - more quickly and more directly, perhaps, by referencing the - $LM00 common block, but I know that this works. */ - - STKSTAT (&status); - - /* Set up the iteration. */ - - trailer = (struct stk_trailer *) (status.current_address - + status.current_size - - 15); - - /* There must be at least one stack segment. Therefore it is - a fatal error if "trailer" is null. */ - - if (trailer == 0) - abort (); - - /* Discard segments that do not contain our argument address. */ - - while (trailer != 0) - { - block = (long *) trailer->this_address; - size = trailer->this_size; - if (block == 0 || size == 0) - abort (); - trailer = (struct stk_trailer *) trailer->link; - if ((block <= address) && (address < (block + size))) - break; - } - - /* Set the result to the offset in this segment and add the sizes - of all predecessor segments. */ - - result = address - block; - - if (trailer == 0) - { - return result; - } - - do - { - if (trailer->this_size <= 0) - abort (); - result += trailer->this_size; - trailer = (struct stk_trailer *) trailer->link; - } - while (trailer != 0); - - /* We are done. Note that if you present a bogus address (one - not in any segment), you will get a different number back, formed - from subtracting the address of the first block. This is probably - not what you want. */ - - return (result); -} - -#else /* not CRAY2 */ -/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. - Determine the number of the cell within the stack, - given the address of the cell. The purpose of this - routine is to linearize, in some sense, stack addresses - for alloca. */ - -static long -i00afunc (long address) -{ - long stkl = 0; - - long size, pseg, this_segment, stack; - long result = 0; - - struct stack_segment_linkage *ssptr; - - /* Register B67 contains the address of the end of the - current stack segment. If you (as a subprogram) store - your registers on the stack and find that you are past - the contents of B67, you have overflowed the segment. - - B67 also points to the stack segment linkage control - area, which is what we are really interested in. */ - - stkl = CRAY_STACKSEG_END (); - ssptr = (struct stack_segment_linkage *) stkl; - - /* If one subtracts 'size' from the end of the segment, - one has the address of the first word of the segment. - - If this is not the first segment, 'pseg' will be - nonzero. */ - - pseg = ssptr->sspseg; - size = ssptr->sssize; - - this_segment = stkl - size; - - /* It is possible that calling this routine itself caused - a stack overflow. Discard stack segments which do not - contain the target address. */ - - while (!(this_segment <= address && address <= stkl)) - { -#ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); -#endif - if (pseg == 0) - break; - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - this_segment = stkl - size; - } - - result = address - this_segment; - - /* If you subtract pseg from the current end of the stack, - you get the address of the previous stack segment's end. - This seems a little convoluted to me, but I'll bet you save - a cycle somewhere. */ - - while (pseg != 0) - { -#ifdef DEBUG_I00AFUNC - fprintf (stderr, "%011o %011o\n", pseg, size); -#endif - stkl = stkl - pseg; - ssptr = (struct stack_segment_linkage *) stkl; - size = ssptr->sssize; - pseg = ssptr->sspseg; - result += size; - } - return (result); -} - -#endif /* not CRAY2 */ -#endif /* CRAY */ - -#endif /* no alloca */ -#endif /* not GCC version 2 */ diff --git a/gnu/egcs/libiberty/argv.c b/gnu/egcs/libiberty/argv.c deleted file mode 100644 index f596ffd0110..00000000000 --- a/gnu/egcs/libiberty/argv.c +++ /dev/null @@ -1,386 +0,0 @@ -/* Create and destroy argument vectors (argv's) - Copyright (C) 1992 Free Software Foundation, Inc. - Written by Fred Fish @ Cygnus Support - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - - -/* Create and destroy argument vectors. An argument vector is simply an - array of string pointers, terminated by a NULL pointer. */ - -#include "ansidecl.h" -#include "libiberty.h" - -#ifdef isspace -#undef isspace -#endif -#define isspace(ch) ((ch) == ' ' || (ch) == '\t') - -/* Routines imported from standard C runtime libraries. */ - -#ifdef __STDC__ - -#include <stddef.h> -#include <string.h> -#include <stdlib.h> - -#else /* !__STDC__ */ - -#if !defined _WIN32 || defined __GNUC__ -extern char *memcpy (); /* Copy memory region */ -extern int strlen (); /* Count length of string */ -extern char *malloc (); /* Standard memory allocater */ -extern char *realloc (); /* Standard memory reallocator */ -extern void free (); /* Free malloc'd memory */ -extern char *strdup (); /* Duplicate a string */ -#endif - -#endif /* __STDC__ */ - -#include "alloca-conf.h" - -#ifndef NULL -#define NULL 0 -#endif - -#ifndef EOS -#define EOS '\0' -#endif - -#define INITIAL_MAXARGC 8 /* Number of args + NULL in initial argv */ - - -/* - -NAME - - dupargv -- duplicate an argument vector - -SYNOPSIS - - char **dupargv (vector) - char **vector; - -DESCRIPTION - - Duplicate an argument vector. Simply scans through the - vector, duplicating each argument until the - terminating NULL is found. - -RETURNS - - Returns a pointer to the argument vector if - successful. Returns NULL if there is insufficient memory to - complete building the argument vector. - -*/ - -char ** -dupargv (argv) - char **argv; -{ - int argc; - char **copy; - - if (argv == NULL) - return NULL; - - /* the vector */ - for (argc = 0; argv[argc] != NULL; argc++); - copy = (char **) malloc ((argc + 1) * sizeof (char *)); - if (copy == NULL) - return NULL; - - /* the strings */ - for (argc = 0; argv[argc] != NULL; argc++) - { - int len = strlen (argv[argc]); - copy[argc] = malloc (sizeof (char *) * (len + 1)); - if (copy[argc] == NULL) - { - freeargv (copy); - return NULL; - } - strcpy (copy[argc], argv[argc]); - } - copy[argc] = NULL; - return copy; -} - -/* - -NAME - - freeargv -- free an argument vector - -SYNOPSIS - - void freeargv (vector) - char **vector; - -DESCRIPTION - - Free an argument vector that was built using buildargv. Simply scans - through the vector, freeing the memory for each argument until the - terminating NULL is found, and then frees the vector itself. - -RETURNS - - No value. - -*/ - -void freeargv (vector) -char **vector; -{ - register char **scan; - - if (vector != NULL) - { - for (scan = vector; *scan != NULL; scan++) - { - free (*scan); - } - free (vector); - } -} - -/* - -NAME - - buildargv -- build an argument vector from a string - -SYNOPSIS - - char **buildargv (sp) - char *sp; - -DESCRIPTION - - Given a pointer to a string, parse the string extracting fields - separated by whitespace and optionally enclosed within either single - or double quotes (which are stripped off), and build a vector of - pointers to copies of the string for each field. The input string - remains unchanged. - - All of the memory for the pointer array and copies of the string - is obtained from malloc. All of the memory can be returned to the - system with the single function call freeargv, which takes the - returned result of buildargv, as it's argument. - - The memory for the argv array is dynamically expanded as necessary. - -RETURNS - - Returns a pointer to the argument vector if successful. Returns NULL - if the input string pointer is NULL or if there is insufficient - memory to complete building the argument vector. - -NOTES - - In order to provide a working buffer for extracting arguments into, - with appropriate stripping of quotes and translation of backslash - sequences, we allocate a working buffer at least as long as the input - string. This ensures that we always have enough space in which to - work, since the extracted arg is never larger than the input string. - - If the input is a null string (as opposed to a NULL pointer), then - buildarg returns an argv that has one arg, a null string. - - Argv is always kept terminated with a NULL arg pointer, so it can - be passed to freeargv at any time, or returned, as appropriate. -*/ - -char **buildargv (input) -char *input; -{ - char *arg; - char *copybuf; - int squote = 0; - int dquote = 0; - int bsquote = 0; - int argc = 0; - int maxargc = 0; - char **argv = NULL; - char **nargv; - - if (input != NULL) - { - copybuf = (char *) alloca (strlen (input) + 1); - /* Is a do{}while to always execute the loop once. Always return an - argv, even for null strings. See NOTES above, test case below. */ - do - { - /* Pick off argv[argc] */ - while (isspace (*input)) - { - input++; - } - if ((maxargc == 0) || (argc >= (maxargc - 1))) - { - /* argv needs initialization, or expansion */ - if (argv == NULL) - { - maxargc = INITIAL_MAXARGC; - nargv = (char **) malloc (maxargc * sizeof (char *)); - } - else - { - maxargc *= 2; - nargv = (char **) realloc (argv, maxargc * sizeof (char *)); - } - if (nargv == NULL) - { - if (argv != NULL) - { - freeargv (argv); - argv = NULL; - } - break; - } - argv = nargv; - argv[argc] = NULL; - } - /* Begin scanning arg */ - arg = copybuf; - while (*input != EOS) - { - if (isspace (*input) && !squote && !dquote && !bsquote) - { - break; - } - else - { - if (bsquote) - { - bsquote = 0; - *arg++ = *input; - } - else if (*input == '\\') - { - bsquote = 1; - } - else if (squote) - { - if (*input == '\'') - { - squote = 0; - } - else - { - *arg++ = *input; - } - } - else if (dquote) - { - if (*input == '"') - { - dquote = 0; - } - else - { - *arg++ = *input; - } - } - else - { - if (*input == '\'') - { - squote = 1; - } - else if (*input == '"') - { - dquote = 1; - } - else - { - *arg++ = *input; - } - } - input++; - } - } - *arg = EOS; - argv[argc] = strdup (copybuf); - if (argv[argc] == NULL) - { - freeargv (argv); - argv = NULL; - break; - } - argc++; - argv[argc] = NULL; - - while (isspace (*input)) - { - input++; - } - } - while (*input != EOS); - } - return (argv); -} - -#ifdef MAIN - -/* Simple little test driver. */ - -static char *tests[] = -{ - "a simple command line", - "arg 'foo' is single quoted", - "arg \"bar\" is double quoted", - "arg \"foo bar\" has embedded whitespace", - "arg 'Jack said \\'hi\\'' has single quotes", - "arg 'Jack said \\\"hi\\\"' has double quotes", - "a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9", - - /* This should be expanded into only one argument. */ - "trailing-whitespace ", - - "", - NULL -}; - -main () -{ - char **argv; - char **test; - char **targs; - - for (test = tests; *test != NULL; test++) - { - printf ("buildargv(\"%s\")\n", *test); - if ((argv = buildargv (*test)) == NULL) - { - printf ("failed!\n\n"); - } - else - { - for (targs = argv; *targs != NULL; targs++) - { - printf ("\t\"%s\"\n", *targs); - } - printf ("\n"); - } - freeargv (argv); - } - -} - -#endif /* MAIN */ diff --git a/gnu/egcs/libiberty/asprintf.c b/gnu/egcs/libiberty/asprintf.c deleted file mode 100644 index 5aaf3200f0d..00000000000 --- a/gnu/egcs/libiberty/asprintf.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Like sprintf but provides a pointer to malloc'd storage, which must - be freed by the caller. - Copyright (C) 1997 Free Software Foundation, Inc. - Contributed by Cygnus Solutions. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "ansidecl.h" -#include "libiberty.h" - -#if defined (ANSI_PROTOTYPES) || defined (ALMOST_STDC) -#define USE_STDARG -#endif - -#ifdef USE_STDARG -#include <stdarg.h> -#else -#include <varargs.h> -#endif - -/* VARARGS */ -#ifdef USE_STDARG -int -asprintf (char **buf, const char *fmt, ...) -#else -int -asprintf (buf, fmt, va_alist) - char **buf; - const char *fmt; - va_dcl -#endif -{ - int status; - va_list ap; -#ifdef USE_STDARG - va_start (ap, fmt); -#else - va_start (ap); -#endif - status = vasprintf (buf, fmt, ap); - va_end (ap); - return status; -} diff --git a/gnu/egcs/libiberty/atexit.c b/gnu/egcs/libiberty/atexit.c deleted file mode 100644 index 137d985e4cb..00000000000 --- a/gnu/egcs/libiberty/atexit.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */ -/* This function is in the public domain. --Mike Stump. */ - -#include "config.h" - -#ifdef HAVE_ON_EXIT - -int -atexit(f) - void (*f)(); -{ - /* If the system doesn't provide a definition for atexit, use on_exit - if the system provides that. */ - on_exit (f, 0); - return 0; -} - -#endif diff --git a/gnu/egcs/libiberty/basename.c b/gnu/egcs/libiberty/basename.c deleted file mode 100644 index 7698f06f8ae..00000000000 --- a/gnu/egcs/libiberty/basename.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Return the basename of a pathname. - This file is in the public domain. */ - -/* -NAME - basename -- return pointer to last component of a pathname - -SYNOPSIS - char *basename (const char *name) - -DESCRIPTION - Given a pointer to a string containing a typical pathname - (/usr/src/cmd/ls/ls.c for example), returns a pointer to the - last component of the pathname ("ls.c" in this case). - -BUGS - Presumes a UNIX or DOS/Windows style path with UNIX or DOS/Windows - style separators. -*/ - -#include "ansidecl.h" -#include "libiberty.h" -#include <ctype.h> - -#ifndef DIR_SEPARATOR -#define DIR_SEPARATOR '/' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -#define HAVE_DOS_BASED_FILE_SYSTEM -#ifndef DIR_SEPARATOR_2 -#define DIR_SEPARATOR_2 '\\' -#endif -#endif - -/* Define IS_DIR_SEPARATOR. */ -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -char * -basename (name) - const char *name; -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha (name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - { - if (IS_DIR_SEPARATOR (*name)) - { - base = name + 1; - } - } - return (char *) base; -} - diff --git a/gnu/egcs/libiberty/bcmp.c b/gnu/egcs/libiberty/bcmp.c deleted file mode 100644 index 11e4417db15..00000000000 --- a/gnu/egcs/libiberty/bcmp.c +++ /dev/null @@ -1,49 +0,0 @@ -/* bcmp - This function is in the public domain. */ - -/* - -NAME - - bcmp -- compare two memory regions - -SYNOPSIS - - int bcmp (char *from, char *to, int count) - -DESCRIPTION - - Compare two memory regions and return zero if they are identical, - non-zero otherwise. If count is zero, return zero. - -NOTES - - No guarantee is made about the non-zero returned value. In - particular, the results may be signficantly different than - strcmp(), where the return value is guaranteed to be less than, - equal to, or greater than zero, according to lexicographical - sorting of the compared regions. - -BUGS - -*/ - - -int -bcmp (from, to, count) - char *from, *to; - int count; -{ - int rtnval = 0; - - while (count-- > 0) - { - if (*from++ != *to++) - { - rtnval = 1; - break; - } - } - return (rtnval); -} - diff --git a/gnu/egcs/libiberty/bcopy.c b/gnu/egcs/libiberty/bcopy.c deleted file mode 100644 index b655363d879..00000000000 --- a/gnu/egcs/libiberty/bcopy.c +++ /dev/null @@ -1,35 +0,0 @@ -/* bcopy -- copy memory regions of arbitary length - -NAME - bcopy -- copy memory regions of arbitrary length - -SYNOPSIS - void bcopy (char *in, char *out, int length) - -DESCRIPTION - Copy LENGTH bytes from memory region pointed to by IN to memory - region pointed to by OUT. - -BUGS - Significant speed improvements can be made in some cases by - implementing copies of multiple bytes simultaneously, or unrolling - the copy loop. - -*/ - -void -bcopy (src, dest, len) - register char *src, *dest; - int len; -{ - if (dest < src) - while (len--) - *dest++ = *src++; - else - { - char *lasts = src + (len-1); - char *lastd = dest + (len-1); - while (len--) - *(char *)lastd-- = *(char *)lasts--; - } -} diff --git a/gnu/egcs/libiberty/bsearch.c b/gnu/egcs/libiberty/bsearch.c deleted file mode 100644 index 6a8ee33341d..00000000000 --- a/gnu/egcs/libiberty/bsearch.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. [rescinded 22 July 1999] - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "config.h" -#include "ansidecl.h" -#include <sys/types.h> /* size_t */ -#include <stdio.h> - -/* - * Perform a binary search. - * - * The code below is a bit sneaky. After a comparison fails, we - * divide the work in half by moving either left or right. If lim - * is odd, moving left simply involves halving lim: e.g., when lim - * is 5 we look at item 2, so we change lim to 2 so that we will - * look at items 0 & 1. If lim is even, the same applies. If lim - * is odd, moving right again involes halving lim, this time moving - * the base up one item past p: e.g., when lim is 5 we change base - * to item 3 and make lim 2 so that we will look at items 3 and 4. - * If lim is even, however, we have to shrink it by one before - * halving: e.g., when lim is 4, we still looked at item 2, so we - * have to make lim 3, then halve, obtaining 1, so that we will only - * look at item 3. - */ -void * -bsearch(key, base0, nmemb, size, compar) - register void *key; - void *base0; - size_t nmemb; - register size_t size; - register int (*compar)(); -{ - register char *base = base0; - register int lim, cmp; - register void *p; - - for (lim = nmemb; lim != 0; lim >>= 1) { - p = base + (lim >> 1) * size; - cmp = (*compar)(key, p); - if (cmp == 0) - return (p); - if (cmp > 0) { /* key > p: move right */ - base = (char *)p + size; - lim--; - } /* else move left */ - } - return (NULL); -} diff --git a/gnu/egcs/libiberty/bzero.c b/gnu/egcs/libiberty/bzero.c deleted file mode 100644 index d01644b7f4b..00000000000 --- a/gnu/egcs/libiberty/bzero.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Portable version of bzero for systems without it. - This function is in the public domain. */ - -/* -NAME - bzero -- zero the contents of a specified memory region - -SYNOPSIS - void bzero (char *to, int count) - -DESCRIPTION - Zero COUNT bytes of memory pointed to by TO. - -BUGS - Significant speed enhancements may be made in some environments - by zeroing more than a single byte at a time, or by unrolling the - loop. - -*/ - - -void -bzero (to, count) - char *to; - int count; -{ - while (count-- > 0) - { - *to++ = 0; - } -} diff --git a/gnu/egcs/libiberty/calloc.c b/gnu/egcs/libiberty/calloc.c deleted file mode 100644 index c8c0a78a7a1..00000000000 --- a/gnu/egcs/libiberty/calloc.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "ansidecl.h" -#include "libiberty.h" - -#ifdef ANSI_PROTOTYPES -#include <stddef.h> -#else -#define size_t unsigned long -#endif - -/* For systems with larger pointers than ints, this must be declared. */ -PTR malloc PARAMS ((size_t)); - -PTR -calloc (nelem, elsize) - size_t nelem, elsize; -{ - register PTR ptr; - - if (nelem == 0 || elsize == 0) - nelem = elsize = 1; - - ptr = malloc (nelem * elsize); - if (ptr) bzero (ptr, nelem * elsize); - - return ptr; -} diff --git a/gnu/egcs/libiberty/choose-temp.c b/gnu/egcs/libiberty/choose-temp.c deleted file mode 100644 index 3babdcda511..00000000000 --- a/gnu/egcs/libiberty/choose-temp.c +++ /dev/null @@ -1,206 +0,0 @@ -/* Utility to pick a temporary filename prefix. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* This file exports two functions: choose_temp_base and make_temp_file. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdio.h> /* May get P_tmpdir. */ -#include <sys/types.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#ifdef HAVE_SYS_FILE_H -#include <sys/file.h> /* May get R_OK, etc. on some systems. */ -#endif - -#ifndef R_OK -#define R_OK 4 -#define W_OK 2 -#define X_OK 1 -#endif - -#include "libiberty.h" -extern int mkstemps (); - -#ifndef IN_GCC -#if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN__) && ! defined (_UWIN)) -#define DIR_SEPARATOR '\\' -#endif -#endif - -#ifndef DIR_SEPARATOR -#define DIR_SEPARATOR '/' -#endif - -/* On MSDOS, write temp files in current dir - because there's no place else we can expect to use. */ -/* ??? Although the current directory is tried as a last resort, - this is left in so that on MSDOS it is preferred to /tmp on the - off chance that someone requires this, since that was the previous - behaviour. */ -#ifdef __MSDOS__ -#ifndef P_tmpdir -#define P_tmpdir "." -#endif -#endif - -/* Name of temporary file. - mktemp requires 6 trailing X's. */ -#define TEMP_FILE "ccXXXXXX" - -/* Subroutine of choose_temp_base. - If BASE is non-NULL, return it. - Otherwise it checks if DIR is a usable directory. - If success, DIR is returned. - Otherwise NULL is returned. */ - -static char * -try (dir, base) - char *dir, *base; -{ - if (base != 0) - return base; - if (dir != 0 - && access (dir, R_OK | W_OK | X_OK) == 0) - return dir; - return 0; -} - -#if defined(__MSDOS__) && !defined(__GO32__) -/* Return a prefix for temporary file names or NULL if unable to find one. - The current directory is chosen if all else fails so the program is - exited if a temporary directory can't be found (mktemp fails). - The buffer for the result is obtained with xmalloc. - - This function is provided for backwards compatability only. It use - is not recommended. */ - -char * -choose_temp_base () -{ - char *base = 0; - char *temp_filename; - int len; - static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 }; - static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 }; - - base = try (getenv ("TMPDIR"), base); - base = try (getenv ("TMP"), base); - base = try (getenv ("TEMP"), base); - -#ifdef P_tmpdir - base = try (P_tmpdir, base); -#endif - - /* Try /usr/tmp, then /tmp. */ - base = try (usrtmp, base); - base = try (tmp, base); - - /* If all else fails, use the current directory! */ - if (base == 0) - base = "."; - - len = strlen (base); - temp_filename = xmalloc (len + 1 /*DIR_SEPARATOR*/ - + strlen (TEMP_FILE) + 1); - strcpy (temp_filename, base); - - if (len != 0 - && temp_filename[len-1] != '/' - && temp_filename[len-1] != DIR_SEPARATOR) - temp_filename[len++] = DIR_SEPARATOR; - strcpy (temp_filename + len, TEMP_FILE); - - mktemp (temp_filename); - if (strlen (temp_filename) == 0) - abort (); - return temp_filename; -} -#endif - -/* Return a temporary file name (as a string) or NULL if unable to create - one. */ - -char * -make_temp_file (suffix) - const char *suffix; -{ - char *base = 0; - char *temp_filename; - int base_len, suffix_len; - int fd; - static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 }; - static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 }; - - base = try (getenv ("TMPDIR"), base); - base = try (getenv ("TMP"), base); - base = try (getenv ("TEMP"), base); - -#ifdef P_tmpdir - base = try (P_tmpdir, base); -#endif - - /* Try /usr/tmp, then /tmp. */ - base = try (usrtmp, base); - base = try (tmp, base); - - /* If all else fails, use the current directory! */ - if (base == 0) - base = "."; - - base_len = strlen (base); - - if (suffix) - suffix_len = strlen (suffix); - else - suffix_len = 0; - - temp_filename = xmalloc (base_len + 1 /*DIR_SEPARATOR*/ - + strlen (TEMP_FILE) - + suffix_len + 1); - strcpy (temp_filename, base); - - if (base_len != 0 - && temp_filename[base_len-1] != '/' - && temp_filename[base_len-1] != DIR_SEPARATOR) - temp_filename[base_len++] = DIR_SEPARATOR; - strcpy (temp_filename + base_len, TEMP_FILE); - - if (suffix) - strcat (temp_filename, suffix); - - fd = mkstemps (temp_filename, suffix_len); - /* If mkstemps failed, then something bad is happening. Maybe we should - issue a message about a possible security attack in progress? */ - if (fd == -1) - abort (); - /* Similarly if we can not close the file. */ - if (close (fd)) - abort (); - return temp_filename; -} diff --git a/gnu/egcs/libiberty/clock.c b/gnu/egcs/libiberty/clock.c deleted file mode 100644 index 8d265406c39..00000000000 --- a/gnu/egcs/libiberty/clock.c +++ /dev/null @@ -1,79 +0,0 @@ -/* ANSI-compatible clock function. - Copyright (C) 1994, 1995, 1999 Free Software Foundation, Inc. - -This file is part of the libiberty library. This library is free -software; you can redistribute it and/or modify it under the -terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) -any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -As a special exception, if you link this library with files -compiled with a GNU compiler to produce an executable, this does not cause -the resulting executable to be covered by the GNU General Public License. -This exception does not however invalidate any other reasons why -the executable file might be covered by the GNU General Public License. */ - -#include "config.h" - -#ifdef HAVE_GETRUSAGE -#include <sys/time.h> -#include <sys/resource.h> -#endif - -#ifdef HAVE_TIMES -#ifdef HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif -#include <sys/times.h> -#endif - -#if defined (HAVE_TIMES) && ! defined (HZ) && defined (CLOCKS_PER_SEC) -#define HZ CLOCKS_PER_SEC -#endif - -/* FIXME: should be able to declare as clock_t. */ - -long -clock () -{ -#ifdef HAVE_GETRUSAGE - struct rusage rusage; - - getrusage (0, &rusage); - return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec - + rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec); -#else -#ifdef HAVE_TIMES - struct tms tms; - - times (&tms); - return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ); -#else -#ifdef VMS - struct - { - int proc_user_time; - int proc_system_time; - int child_user_time; - int child_system_time; - } vms_times; - - times (&vms_times); - return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000; -#else - /* A fallback, if nothing else available. */ - return 0; -#endif /* VMS */ -#endif /* HAVE_TIMES */ -#endif /* HAVE_GETRUSAGE */ -} - diff --git a/gnu/egcs/libiberty/concat.c b/gnu/egcs/libiberty/concat.c deleted file mode 100644 index 5b132c85764..00000000000 --- a/gnu/egcs/libiberty/concat.c +++ /dev/null @@ -1,167 +0,0 @@ -/* Concatenate variable number of strings. - Copyright (C) 1991, 1994 Free Software Foundation, Inc. - Written by Fred Fish @ Cygnus Support - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - - -/* - -NAME - - concat -- concatenate a variable number of strings - -SYNOPSIS - - #include <varargs.h> - - char *concat (s1, s2, s3, ..., NULL) - -DESCRIPTION - - Concatenate a variable number of strings and return the result - in freshly malloc'd memory. - - Returns NULL if insufficient memory is available. The argument - list is terminated by the first NULL pointer encountered. Pointers - to empty strings are ignored. - -NOTES - - This function uses xmalloc() which is expected to be a front end - function to malloc() that deals with low memory situations. In - typical use, if malloc() returns NULL then xmalloc() diverts to an - error handler routine which never returns, and thus xmalloc will - never return a NULL pointer. If the client application wishes to - deal with low memory situations itself, it should supply an xmalloc - that just directly invokes malloc and blindly returns whatever - malloc returns. -*/ - - -#include "ansidecl.h" -#include "libiberty.h" - -#ifdef ANSI_PROTOTYPES -#include <stdarg.h> -#else -#include <varargs.h> -#endif - -#ifdef __STDC__ -#include <stddef.h> -extern size_t strlen (const char *s); -#else -extern int strlen (); -#endif - -#define NULLP (char *)0 - -/* VARARGS */ -#ifdef ANSI_PROTOTYPES -char * -concat (const char *first, ...) -#else -char * -concat (va_alist) - va_dcl -#endif -{ - register int length; - register char *newstr; - register char *end; - register const char *arg; - va_list args; -#ifndef ANSI_PROTOTYPES - const char *first; -#endif - - /* First compute the size of the result and get sufficient memory. */ - -#ifdef ANSI_PROTOTYPES - va_start (args, first); -#else - va_start (args); - first = va_arg (args, const char *); -#endif - - if (first == NULLP) - length = 0; - else - { - length = strlen (first); - while ((arg = va_arg (args, const char *)) != NULLP) - { - length += strlen (arg); - } - } - newstr = (char *) xmalloc (length + 1); - va_end (args); - - /* Now copy the individual pieces to the result string. */ - - if (newstr != NULLP) - { -#ifdef ANSI_PROTOTYPES - va_start (args, first); -#else - va_start (args); - first = va_arg (args, const char *); -#endif - end = newstr; - if (first != NULLP) - { - arg = first; - while (*arg) - { - *end++ = *arg++; - } - while ((arg = va_arg (args, const char *)) != NULLP) - { - while (*arg) - { - *end++ = *arg++; - } - } - } - *end = '\000'; - va_end (args); - } - - return (newstr); -} - -#ifdef MAIN - -/* Simple little test driver. */ - -#include <stdio.h> - -int -main () -{ - printf ("\"\" = \"%s\"\n", concat (NULLP)); - printf ("\"a\" = \"%s\"\n", concat ("a", NULLP)); - printf ("\"ab\" = \"%s\"\n", concat ("a", "b", NULLP)); - printf ("\"abc\" = \"%s\"\n", concat ("a", "b", "c", NULLP)); - printf ("\"abcd\" = \"%s\"\n", concat ("ab", "cd", NULLP)); - printf ("\"abcde\" = \"%s\"\n", concat ("ab", "c", "de", NULLP)); - printf ("\"abcdef\" = \"%s\"\n", concat ("", "a", "", "bcd", "ef", NULLP)); - return 0; -} - -#endif diff --git a/gnu/egcs/libiberty/config.h-vms b/gnu/egcs/libiberty/config.h-vms deleted file mode 100644 index ccac6a2bcc7..00000000000 --- a/gnu/egcs/libiberty/config.h-vms +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef NEED_strerror -#define NEED_strerror -#endif -#ifndef NEED_basename -#define NEED_basename -#endif -#ifndef NEED_psignal -#define NEED_psignal -#endif -#ifndef NEED_on_exit -#define NEED_on_exit -#endif - diff --git a/gnu/egcs/libiberty/config.in b/gnu/egcs/libiberty/config.in deleted file mode 100644 index 6e64208da92..00000000000 --- a/gnu/egcs/libiberty/config.in +++ /dev/null @@ -1,224 +0,0 @@ -/* config.in. Generated automatically from configure.in by autoheader. */ - -/* Define if using alloca.c. */ -#undef C_ALLOCA - -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ -#undef CRAY_STACKSEG_END - -/* Define if you have alloca, as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ -#undef HAVE_ALLOCA_H - -/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H - -/* Define if you have <vfork.h>. */ -#undef HAVE_VFORK_H - -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef pid_t - -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define vfork as fork if vfork does not work. */ -#undef vfork - -/* Define if you have the sys_errlist variable. */ -#undef HAVE_SYS_ERRLIST - -/* Define if you have the sys_nerr variable. */ -#undef HAVE_SYS_NERR - -/* Define if you have the sys_siglist variable. */ -#undef HAVE_SYS_SIGLIST - -/* Define if you have the strerror function. */ -#undef HAVE_STRERROR - -/* Define if you have the asprintf function. */ -#undef HAVE_ASPRINTF - -/* Define if you have the atexit function. */ -#undef HAVE_ATEXIT - -/* Define if you have the basename function. */ -#undef HAVE_BASENAME - -/* Define if you have the bcmp function. */ -#undef HAVE_BCMP - -/* Define if you have the bcopy function. */ -#undef HAVE_BCOPY - -/* Define if you have the bzero function. */ -#undef HAVE_BZERO - -/* Define if you have the calloc function. */ -#undef HAVE_CALLOC - -/* Define if you have the clock function. */ -#undef HAVE_CLOCK - -/* Define if you have the getcwd function. */ -#undef HAVE_GETCWD - -/* Define if you have the getpagesize function. */ -#undef HAVE_GETPAGESIZE - -/* Define if you have the getrusage function. */ -#undef HAVE_GETRUSAGE - -/* Define if you have the gettimeofday function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define if you have the index function. */ -#undef HAVE_INDEX - -/* Define if you have the insque function. */ -#undef HAVE_INSQUE - -/* Define if you have the memchr function. */ -#undef HAVE_MEMCHR - -/* Define if you have the memcmp function. */ -#undef HAVE_MEMCMP - -/* Define if you have the memcpy function. */ -#undef HAVE_MEMCPY - -/* Define if you have the memmove function. */ -#undef HAVE_MEMMOVE - -/* Define if you have the memset function. */ -#undef HAVE_MEMSET - -/* Define if you have the mkstemps function. */ -#undef HAVE_MKSTEMPS - -/* Define if you have the on_exit function. */ -#undef HAVE_ON_EXIT - -/* Define if you have the psignal function. */ -#undef HAVE_PSIGNAL - -/* Define if you have the putenv function. */ -#undef HAVE_PUTENV - -/* Define if you have the random function. */ -#undef HAVE_RANDOM - -/* Define if you have the rename function. */ -#undef HAVE_RENAME - -/* Define if you have the rindex function. */ -#undef HAVE_RINDEX - -/* Define if you have the sbrk function. */ -#undef HAVE_SBRK - -/* Define if you have the setenv function. */ -#undef HAVE_SETENV - -/* Define if you have the sigsetmask function. */ -#undef HAVE_SIGSETMASK - -/* Define if you have the strcasecmp function. */ -#undef HAVE_STRCASECMP - -/* Define if you have the strchr function. */ -#undef HAVE_STRCHR - -/* Define if you have the strdup function. */ -#undef HAVE_STRDUP - -/* Define if you have the strerror function. */ -#undef HAVE_STRERROR - -/* Define if you have the strncasecmp function. */ -#undef HAVE_STRNCASECMP - -/* Define if you have the strrchr function. */ -#undef HAVE_STRRCHR - -/* Define if you have the strsignal function. */ -#undef HAVE_STRSIGNAL - -/* Define if you have the strstr function. */ -#undef HAVE_STRSTR - -/* Define if you have the strtod function. */ -#undef HAVE_STRTOD - -/* Define if you have the strtol function. */ -#undef HAVE_STRTOL - -/* Define if you have the strtoul function. */ -#undef HAVE_STRTOUL - -/* Define if you have the sysconf function. */ -#undef HAVE_SYSCONF - -/* Define if you have the times function. */ -#undef HAVE_TIMES - -/* Define if you have the tmpnam function. */ -#undef HAVE_TMPNAM - -/* Define if you have the vasprintf function. */ -#undef HAVE_VASPRINTF - -/* Define if you have the vfprintf function. */ -#undef HAVE_VFPRINTF - -/* Define if you have the vprintf function. */ -#undef HAVE_VPRINTF - -/* Define if you have the vsprintf function. */ -#undef HAVE_VSPRINTF - -/* Define if you have the waitpid function. */ -#undef HAVE_WAITPID - -/* Define if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the <sys/file.h> header file. */ -#undef HAVE_SYS_FILE_H - -/* Define if you have the <sys/param.h> header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define if you have the <sys/resource.h> header file. */ -#undef HAVE_SYS_RESOURCE_H - -/* Define if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define if you have the <sys/time.h> header file. */ -#undef HAVE_SYS_TIME_H - -/* Define if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H diff --git a/gnu/egcs/libiberty/config.table b/gnu/egcs/libiberty/config.table deleted file mode 100644 index 4e33746164c..00000000000 --- a/gnu/egcs/libiberty/config.table +++ /dev/null @@ -1,61 +0,0 @@ -case "${host}" in - rs6000-ibm-aix3.1 | rs6000-ibm-aix) - frag=mh-aix ;; - *-*-cxux7*) frag=mh-cxux7 ;; - *-*-freebsd2.1.*) frag=mh-fbsd21 ;; - *-*-freebsd2.2.[012]) frag=mh-fbsd21 ;; - i370-*-opened*) frag=mh-openedition ;; - i[345]86-*-windows*) frag=mh-windows ;; - *-*-beos*) frag=mh-beos ;; -esac - -frags=$frag - -# If they didn't specify --enable-shared, don't generate shared libs. -case "${enable_shared}" in - yes) shared=yes ;; - no) shared=no ;; - "") shared=no ;; - *) shared=yes ;; -esac -if [ "${shared}" = "yes" ]; then - case "${host}" in - *-*-cygwin*) ;; - alpha*-*-linux*) frags="${frags} ../../config/mh-elfalphapic" ;; - arm*-*-*) frags="${frags} ../../config/mh-armpic" ;; - hppa*-*-*) frags="${frags} ../../config/mh-papic" ;; - i[3456]86-*-*) frags="${frags} ../../config/mh-x86pic" ;; - powerpc*-*-aix*) ;; - powerpc*-*-*) frags="${frags} ../../config/mh-ppcpic" ;; - *-*-*) frags="${frags} ../../config/mh-${host_cpu}pic" ;; - esac -fi - -echo "# Warning: this fragment is automatically generated" > temp-frag - -for frag in ${frags}; do - case ${frag} in - ../* ) - if [ ${srcdir} = . ]; then - [ -n "${with_target_subdir}" ] && frag=../${frag} - [ -n "${with_multisrctop}" ] && frag=${with_multisrctop}${frag} - fi - ;; - esac - frag=${srcdir}/${xsrcdir}config/$frag - if [ -f ${frag} ]; then - echo "Appending ${frag} to xhost-mkfrag" - echo "# Following fragment copied from ${frag}" >> temp-frag - cat ${frag} >> temp-frag - fi -done - -# record if we want to build shared libs. -if [ "${shared}" = "yes" ]; then - echo enable_shared = yes >> temp-frag -else - echo enable_shared = no >> temp-frag -fi - -frag=xhost-mkfrag -${CONFIG_SHELL-/bin/sh} ${libiberty_topdir}/move-if-change temp-frag xhost-mkfrag diff --git a/gnu/egcs/libiberty/config/mh-aix b/gnu/egcs/libiberty/config/mh-aix deleted file mode 100644 index 6b645058fa9..00000000000 --- a/gnu/egcs/libiberty/config/mh-aix +++ /dev/null @@ -1,9 +0,0 @@ -# This file is only needed by AIX 3.1. -HDEFINES = -D__IEEE_BIG_ENDIAN - -# Most releases of AIX 3.1 include an incorrect internal version of copysign -# in libc.a for use by some libc public functions including modf. The public -# version of copysign in libm.a is usable. For the sake of libg++ (which -# uses modf), we add copysign here. Supposedly, this problem is fixed in AIX -# 3.1.8 and above, including all releases of AIX 3.2. -EXTRA_OFILES = copysign.o diff --git a/gnu/egcs/libiberty/config/mh-beos b/gnu/egcs/libiberty/config/mh-beos deleted file mode 100644 index 9b75e7d3372..00000000000 --- a/gnu/egcs/libiberty/config/mh-beos +++ /dev/null @@ -1,7 +0,0 @@ -# Host makefile fragment for BeOS - -# This is a temporary hack until the wimpy default 64k stack -# limit in BeOS is either increased or made user settable somehow. -# This probably won't happen until after the DR9 release. - -EXTRA_OFILES = alloca.o diff --git a/gnu/egcs/libiberty/config/mh-cxux7 b/gnu/egcs/libiberty/config/mh-cxux7 deleted file mode 100644 index a924b0853fc..00000000000 --- a/gnu/egcs/libiberty/config/mh-cxux7 +++ /dev/null @@ -1 +0,0 @@ -HDEFINES = -DHARRIS_FLOAT_FORMAT diff --git a/gnu/egcs/libiberty/config/mh-fbsd21 b/gnu/egcs/libiberty/config/mh-fbsd21 deleted file mode 100644 index 1375a780bef..00000000000 --- a/gnu/egcs/libiberty/config/mh-fbsd21 +++ /dev/null @@ -1 +0,0 @@ -EXTRA_OFILES=vasprintf.o diff --git a/gnu/egcs/libiberty/config/mh-openedition b/gnu/egcs/libiberty/config/mh-openedition deleted file mode 100644 index 6e8e354be4a..00000000000 --- a/gnu/egcs/libiberty/config/mh-openedition +++ /dev/null @@ -1,3 +0,0 @@ -HDEFINES = -D_ALL_SOURCE -CC=c89 - diff --git a/gnu/egcs/libiberty/config/mh-windows b/gnu/egcs/libiberty/config/mh-windows deleted file mode 100644 index 3ff5f794e9f..00000000000 --- a/gnu/egcs/libiberty/config/mh-windows +++ /dev/null @@ -1 +0,0 @@ -EXTRA_OFILES=asprintf.o strcasecmp.o strncasecmp.o vasprintf.o diff --git a/gnu/egcs/libiberty/configure b/gnu/egcs/libiberty/configure deleted file mode 100644 index e387788250f..00000000000 --- a/gnu/egcs/libiberty/configure +++ /dev/null @@ -1,2953 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --with-target-subdir=SUBDIR Configuring in a subdirectory" -ac_help="$ac_help - --with-cross-host=HOST Configuring with a cross compiler" -ac_help="$ac_help - --with-newlib Configuring with newlib" - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=pexecute.c - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - -# Check whether --with-target-subdir or --without-target-subdir was given. -if test "${with_target_subdir+set}" = set; then - withval="$with_target_subdir" - : -fi - -# Check whether --with-cross-host or --without-cross-host was given. -if test "${with_cross_host+set}" = set; then - withval="$with_cross_host" - : -fi - -# Check whether --with-newlib or --without-newlib was given. -if test "${with_newlib+set}" = set; then - withval="$with_newlib" - : -fi - - -if test "${srcdir}" = "."; then - if test -z "${with_target_subdir}"; then - libiberty_topdir="${srcdir}/.." - else - if test "${with_target_subdir}" != "."; then - libiberty_topdir="${srcdir}/${with_multisrctop}../.." - else - libiberty_topdir="${srcdir}/${with_multisrctop}.." - fi - fi -else - libiberty_topdir="${srcdir}/.." -fi -ac_aux_dir= -for ac_dir in ${GNUSYSTEM_AUX_DIR} $libiberty_topdir $srcdir/$libiberty_topdir; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $libiberty_topdir $srcdir/$libiberty_topdir" 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:591: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - - - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:614: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -if test $host != $build; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:640: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" -fi -fi -AR="$ac_cv_prog_AR" -if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - - -# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:672: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -if test -z "$ac_cv_prog_RANLIB"; then -if test -n "$ac_tool_prefix"; then - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:704: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -else - RANLIB=":" -fi -fi - - -# FIXME: We temporarily define our own version of AC_PROG_CC. This is -# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -# are probably using a cross compiler, which will not be able to fully -# link an executable. This should really be fixed in autoconf -# itself. - - - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:750: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:780: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:829: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes - ac_libiberty_warn_cflags='-W -Wall -Wtraditional' - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:854: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-O2" - fi -else - GCC= - ac_libiberty_warn_cflags= - test "${CFLAGS+set}" = set || CFLAGS="-g" -fi - - -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:884: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then - echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi -else - echo "$ac_t""no" 1>&6 - ISC= -fi - - - - - - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:922: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -. ${srcdir}/config.table -host_makefile_frag=${frag} - - -# It's OK to check for header files. Although the compiler may not be -# able to link anything, it had better be able to at least compile -# something. -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:983: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext <<EOF -#line 998 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext <<EOF -#line 1015 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext <<EOF -#line 1032 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -for ac_hdr in sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h sys/stat.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1066: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1071 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1103: checking for sys/wait.h that is POSIX.1 compatible" >&5 -if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1108 "configure" -#include "confdefs.h" -#include <sys/types.h> -#include <sys/wait.h> -#ifndef WEXITSTATUS -#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) -#endif -#ifndef WIFEXITED -#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif -int main() { -int s; -wait (&s); -s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; -; return 0; } -EOF -if { (eval echo configure:1124: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_header_sys_wait_h=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_sys_wait_h=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 -if test $ac_cv_header_sys_wait_h = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_SYS_WAIT_H 1 -EOF - -fi - - -# This is the list of functions which libiberty will provide if they -# are not available on the host. - -funcs="asprintf" -funcs="$funcs atexit" -funcs="$funcs basename" -funcs="$funcs bcmp" -funcs="$funcs bcopy" -funcs="$funcs bzero" -funcs="$funcs calloc" -funcs="$funcs clock" -funcs="$funcs getcwd" -funcs="$funcs getpagesize" -funcs="$funcs index" -funcs="$funcs insque" -funcs="$funcs memchr" -funcs="$funcs memcmp" -funcs="$funcs memcpy" -funcs="$funcs memmove" -funcs="$funcs memset" -funcs="$funcs mkstemps" -funcs="$funcs putenv" -funcs="$funcs random" -funcs="$funcs rename" -funcs="$funcs rindex" -funcs="$funcs setenv" -funcs="$funcs sigsetmask" -funcs="$funcs strcasecmp" -funcs="$funcs strchr" -funcs="$funcs strdup" -funcs="$funcs strncasecmp" -funcs="$funcs strrchr" -funcs="$funcs strstr" -funcs="$funcs strtod" -funcs="$funcs strtol" -funcs="$funcs strtoul" -funcs="$funcs tmpnam" -funcs="$funcs vasprintf" -funcs="$funcs vfprintf" -funcs="$funcs vprintf" -funcs="$funcs vsprintf" -funcs="$funcs waitpid" - -# Also in the old function.def file: alloca, vfork, getopt. - -vars="sys_errlist sys_nerr sys_siglist" - -checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" - -# These are neither executed nor required, but they help keep -# autoheader happy without adding a bunch of text to acconfig.h. -if test "x" = "y"; then - for ac_func in asprintf atexit basename bcmp bcopy bzero calloc clock getcwd -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1200: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1205 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in getpagesize index insque mkstemps memchr memcmp memcpy memmove -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1255: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1260 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in memset putenv random rename rindex sigsetmask strcasecmp -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1310: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1315 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in setenv strchr strdup strncasecmp strrchr strstr strtod strtol -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1365: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1370 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in strtoul tmpnam vasprintf vfprintf vprintf vsprintf waitpid -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1420: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1425 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - cat >> confdefs.h <<\EOF -#define HAVE_SYS_ERRLIST 1 -EOF - - cat >> confdefs.h <<\EOF -#define HAVE_SYS_NERR 1 -EOF - - cat >> confdefs.h <<\EOF -#define HAVE_SYS_SIGLIST 1 -EOF - - for ac_func in getrusage on_exit psignal strerror strsignal sysconf times -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1487: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1492 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - - for ac_func in sbrk gettimeofday -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1542: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1547 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -fi - -# For each of these functions, if the host does not provide the -# function we want to put FN.o in LIBOBJS, and if the host does -# provide the function, we want to define HAVE_FN in config.h. Also, -# if the host does not provide alloca, we set ALLOCA to alloca.o - -setobjs= -CHECK= -if test -n "${with_target_subdir}"; then - - # We are being configured as a target library. AC_REPLACE_FUNCS - # may not work correctly, because the compiler may not be able to - # link executables. Note that we may still be being configured - # native. - - # If we are being configured for newlib, we know which functions - # newlib provide and which ones we will be expected to provide. - - if test "x${with_newlib}" = "xyes"; then - ALLOCA="alloca.o" - LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o" - - for f in $funcs; do - case "$f" in - asprintf | basename | insque | random | strdup | vasprintf) - ;; - *) - n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $n 1 -EOF - - ;; - esac - done - - # newlib doesnt provide any of the variables in $vars, so we - # dont have to check them here. - - # Of the functions in $checkfuncs, newlib only has strerror. - cat >> confdefs.h <<\EOF -#define HAVE_STRERROR 1 -EOF - - - setobjs=yes - - fi - -else - - # Not a target library, so we set things up to run the test suite. - CHECK=check-cplus-dem - -fi - - - -if test -z "${setobjs}"; then - case "${host}" in - - *-*-vxworks*) - # Handle VxWorks configuration specially, since on VxWorks the - # libraries are actually on the target board, not in the file - # system. - LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o" - LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o" - for f in $funcs; do - case "$f" in - basename | getpagesize | insque | random | strcasecmp) - ;; - strncasecmp | strdup | vfork | waitpid | vasprintf) - ;; - *) - n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $n 1 -EOF - - ;; - esac - done - - # VxWorks doesn't provide any of the variables in $vars, so we - # don't have to check them here. - - # Of the functions in $checkfuncs, VxWorks only has strerror. - cat >> confdefs.h <<\EOF -#define HAVE_STRERROR 1 -EOF - - - setobjs=yes - ;; - - esac -fi - -if test -z "${setobjs}"; then - - case "${host}" in - - *-*-cygwin*) - # The Cygwin library actually uses a couple of files from - # libiberty when it is built. If we are building a native - # Cygwin, and we run the tests, we will appear to have these - # files. However, when we go on to build winsup, we will wind up - # with a library which does not have the files, since they should - # have come from libiberty. - - # We handle this by removing the functions the winsup library - # provides from our shell variables, so that they appear to be - # missing. - - funcs="`echo $funcs | sed -e 's/random//'`" - LIBOBJS="$LIBOBJS random.o" - vars="`echo $vars | sed -e 's/sys_siglist//'`" - checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`" - ;; - - *-*-mingw32*) - # Under mingw32, sys_nerr and sys_errlist exist, but they are - # macros, so the test below won't find them. - vars="`echo $vars | sed -e 's/sys_nerr//' -e 's/sys_errlist//'`" - cat >> confdefs.h <<\EOF -#define HAVE_SYS_NERR 1 -EOF - - cat >> confdefs.h <<\EOF -#define HAVE_SYS_ERRLIST 1 -EOF - - ;; - - *-*-uwin*) - # Under some versions of uwin, vfork is notoriously buggy and the test - # can hang configure; on other versions, vfork exists just as a stub. - # FIXME: This should be removed once vfork in uwin's runtime is fixed. - ac_cv_func_vfork_works=no - # Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are - # macros (actually, these are imported from a DLL, but the end effect - # is the same), so the test below won't find them. - cat >> confdefs.h <<\EOF -#define HAVE_SYS_NERR 1 -EOF - - cat >> confdefs.h <<\EOF -#define HAVE_SYS_ERRLIST 1 -EOF - - ;; - - esac - - # We haven't set the list of objects yet. Use the standard autoconf - # tests. This will only work if the compiler works. - echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1752: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 1763 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:1768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1794: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - - for ac_func in $funcs -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1801: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1806 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" -fi -done - - - - case "${host}" in - *-*-interix) - # On Interix, it wrongly concludes that the MSVC compiler supports alloca. - # (MSVC does on Win32, not on Interix.) - # This should be temporary. - - ac_cv_header_alloca_h=no - ac_cv_func_alloca_works=no - ALLOCA=alloca.o - cat >> confdefs.h <<\EOF -#define C_ALLOCA 1 -EOF - cat >> confdefs.h <<EOF -#define STACK_DIRECTION -1 -EOF - ;; - *) - # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1876: checking for working alloca.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1881 "configure" -#include "confdefs.h" -#include <alloca.h> -int main() { -char *p = alloca(2 * sizeof(int)); -; return 0; } -EOF -if { (eval echo configure:1888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_header_alloca_h=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_alloca_h=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 -if test $ac_cv_header_alloca_h = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA_H 1 -EOF - -fi - -echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1909: checking for alloca" >&5 -if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1914 "configure" -#include "confdefs.h" - -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include <malloc.h> -# define alloca _alloca -# else -# if HAVE_ALLOCA_H -# include <alloca.h> -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int main() { -char *p = (char *) alloca(1); -; return 0; } -EOF -if { (eval echo configure:1942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_func_alloca_works=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_alloca_works=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 -if test $ac_cv_func_alloca_works = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA 1 -EOF - -fi - -if test $ac_cv_func_alloca_works = no; then - # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.${ac_objext} - cat >> confdefs.h <<\EOF -#define C_ALLOCA 1 -EOF - - -echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1974: checking whether alloca needs Cray hooks" >&5 -if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1979 "configure" -#include "confdefs.h" -#if defined(CRAY) && ! defined(CRAY2) -webecray -#else -wenotbecray -#endif - -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_os_cray=yes -else - rm -rf conftest* - ac_cv_os_cray=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_os_cray" 1>&6 -if test $ac_cv_os_cray = yes; then -for ac_func in _getb67 GETB67 getb67; do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2004: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2009 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<EOF -#define CRAY_STACKSEG_END $ac_func -EOF - - break -else - echo "$ac_t""no" 1>&6 -fi - -done -fi - -echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2059: checking stack direction for C alloca" >&5 -if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else - cat > conftest.$ac_ext <<EOF -#line 2067 "configure" -#include "confdefs.h" -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} -main () -{ - exit (find_stack_direction() < 0); -} -EOF -if { (eval echo configure:2086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_c_stack_direction=1 -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_stack_direction=-1 -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 -cat >> confdefs.h <<EOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -EOF - -fi - - ;; - esac - - echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2111: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2116 "configure" -#include "confdefs.h" -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext <<EOF -#line 2141 "configure" -#include "confdefs.h" -#include <string.h> -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext <<EOF -#line 2159 "configure" -#include "confdefs.h" -#include <stdlib.h> -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext <<EOF -#line 2180 "configure" -#include "confdefs.h" -#include <ctype.h> -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:2191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2215: checking for pid_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2220 "configure" -#include "confdefs.h" -#include <sys/types.h> -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_pid_t=yes -else - rm -rf conftest* - ac_cv_type_pid_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_pid_t" 1>&6 -if test $ac_cv_type_pid_t = no; then - cat >> confdefs.h <<\EOF -#define pid_t int -EOF - -fi - -ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2249: checking for vfork.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2254 "configure" -#include "confdefs.h" -#include <vfork.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_VFORK_H 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2284: checking for working vfork" >&5 -if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:2290: checking for vfork" >&5 -if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2295 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char vfork(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char vfork(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_vfork) || defined (__stub___vfork) -choke me -#else -vfork(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_vfork=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_vfork=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - -ac_cv_func_vfork_works=$ac_cv_func_vfork -else - cat > conftest.$ac_ext <<EOF -#line 2340 "configure" -#include "confdefs.h" -/* Thanks to Paul Eggert for this test. */ -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_VFORK_H -#include <vfork.h> -#endif -/* On some sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. - The compiler is told about this with #include <vfork.h>, - but some compilers (e.g. gcc -O) don't grok <vfork.h>. - Test for this by using a static variable whose address - is put into a register that is clobbered by the vfork. */ -static -#ifdef __cplusplus -sparc_address_test (int arg) -#else -sparc_address_test (arg) int arg; -#endif -{ - static pid_t child; - if (!child) { - child = vfork (); - if (child < 0) { - perror ("vfork"); - _exit(2); - } - if (!child) { - arg = getpid(); - write(-1, "", 0); - _exit (arg); - } - } -} -main() { - pid_t parent = getpid (); - pid_t child; - - sparc_address_test (); - - child = vfork (); - - if (child == 0) { - /* Here is another test for sparc vfork register problems. - This test uses lots of local variables, at least - as many local variables as main has allocated so far - including compiler temporaries. 4 locals are enough for - gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. - A buggy compiler should reuse the register of parent - for one of the local variables, since it will think that - parent can't possibly be used any more in this routine. - Assigning to the local variable will thus munge parent - in the parent process. */ - pid_t - p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), - p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); - /* Convince the compiler that p..p7 are live; otherwise, it might - use the same hardware register for all 8 local variables. */ - if (p != p1 || p != p2 || p != p3 || p != p4 - || p != p5 || p != p6 || p != p7) - _exit(1); - - /* On some systems (e.g. IRIX 3.3), - vfork doesn't separate parent from child file descriptors. - If the child closes a descriptor before it execs or exits, - this munges the parent's descriptor as well. - Test for this by closing stdout in the child. */ - _exit(close(fileno(stdout)) != 0); - } else { - int status; - struct stat st; - - while (wait(&status) != child) - ; - exit( - /* Was there some problem with vforking? */ - child < 0 - - /* Did the child fail? (This shouldn't happen.) */ - || status - - /* Did the vfork/compiler bug occur? */ - || parent != getpid() - - /* Did the file descriptor bug occur? */ - || fstat(fileno(stdout), &st) != 0 - ); - } -} -EOF -if { (eval echo configure:2435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_func_vfork_works=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_vfork_works=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$ac_cv_func_vfork_works" 1>&6 -if test $ac_cv_func_vfork_works = no; then - cat >> confdefs.h <<\EOF -#define vfork fork -EOF - -fi - - if test $ac_cv_func_vfork_works = no; then - LIBOBJS="$LIBOBJS vfork.o" - fi - for v in $vars; do - echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2462: checking for $v" >&5 - if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2467 "configure" -#include "confdefs.h" -int *p; -int main() { -extern int $v; p = &$v; -; return 0; } -EOF -if { (eval echo configure:2474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "libiberty_cv_var_$v=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "libiberty_cv_var_$v=no" -fi -rm -f conftest* -fi - - if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then - echo "$ac_t""yes" 1>&6 - n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $n 1 -EOF - - else - echo "$ac_t""no" 1>&6 - fi - done - for ac_func in $checkfuncs -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2500: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2505 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - -fi - -# Install a library built with a cross compiler in $(tooldir) rather -# than $(libdir). -if test -z "${with_cross_host}"; then - INSTALL_DEST=libdir -else - INSTALL_DEST=tooldir -fi - - -# We need multilib support, but only if configuring for the target. -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <<EOF -#! /bin/sh -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile testsuite/Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS <<EOF - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g -s%@AR@%$AR%g -s%@RANLIB@%$RANLIB%g -s%@ac_libiberty_warn_cflags@%$ac_libiberty_warn_cflags%g -s%@CC@%$CC%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -/@host_makefile_frag@/r $host_makefile_frag -s%@host_makefile_frag@%%g -s%@CPP@%$CPP%g -s%@CHECK@%$CHECK%g -s%@LIBOBJS@%$LIBOBJS%g -s%@ALLOCA@%$ALLOCA%g -s%@INSTALL_DEST@%$INSTALL_DEST%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <<EOF - -CONFIG_FILES=\${CONFIG_FILES-"Makefile testsuite/Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <<EOF - CONFIG_HEADERS="config.h:config.in" -EOF -cat >> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <<EOF -srcdir=${srcdir} -host=${host} -target=${target} -with_target_subdir=${with_target_subdir} -with_multisubdir=${with_multisubdir} -ac_configure_args="--enable-multilib ${ac_configure_args}" -CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -libiberty_topdir=${libiberty_topdir} - -EOF -cat >> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h -if test -n "$CONFIG_FILES"; then - if test -n "${with_target_subdir}"; then - # FIXME: We shouldn't need to set ac_file - ac_file=Makefile - . ${libiberty_topdir}/config-ml.in - fi -fi -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - diff --git a/gnu/egcs/libiberty/configure.bat b/gnu/egcs/libiberty/configure.bat deleted file mode 100644 index 18881ac2f75..00000000000 --- a/gnu/egcs/libiberty/configure.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off
-if "%1" == "h8/300" goto h8300
-
-echo Configuring libiberty for go32
-copy Makefile.dos Makefile
-echo #define NEED_sys_siglist 1 >> config.h
-echo #define NEED_psignal 1 >> config.h
-goto exit
-
-:h8300
-echo Configuring libiberty for H8/300
-copy Makefile.dos Makefile
-
-:exit
diff --git a/gnu/egcs/libiberty/configure.in b/gnu/egcs/libiberty/configure.in deleted file mode 100644 index cc1b2c2082b..00000000000 --- a/gnu/egcs/libiberty/configure.in +++ /dev/null @@ -1,382 +0,0 @@ -dnl Process this file with autoconf to produce a configure script - -AC_PREREQ(2.13) -AC_INIT(pexecute.c) - -dnl We use these options to decide which functions to include. -AC_ARG_WITH(target-subdir, -[ --with-target-subdir=SUBDIR Configuring in a subdirectory]) -AC_ARG_WITH(cross-host, -[ --with-cross-host=HOST Configuring with a cross compiler]) -AC_ARG_WITH(newlib, -[ --with-newlib Configuring with newlib]) - -if test "${srcdir}" = "."; then - if test -z "${with_target_subdir}"; then - libiberty_topdir="${srcdir}/.." - else - if test "${with_target_subdir}" != "."; then - libiberty_topdir="${srcdir}/${with_multisrctop}../.." - else - libiberty_topdir="${srcdir}/${with_multisrctop}.." - fi - fi -else - libiberty_topdir="${srcdir}/.." -fi -AC_CONFIG_AUX_DIR($libiberty_topdir) - -AC_CANONICAL_HOST - -dnl When we start using automake: -dnl AM_INIT_AUTOMAKE(libiberty, 1.0) - -dnl These must be called before AM_PROG_LIBTOOL, because it may want -dnl to call AC_CHECK_PROG. -AC_CHECK_TOOL(AR, ar) -AC_CHECK_TOOL(RANLIB, ranlib, :) - -# FIXME: We temporarily define our own version of AC_PROG_CC. This is -# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -# are probably using a cross compiler, which will not be able to fully -# link an executable. This should really be fixed in autoconf -# itself. - -AC_DEFUN(LIB_AC_PROG_CC, -[AC_BEFORE([$0], [AC_PROG_CPP])dnl -AC_PROVIDE([AC_PROG_CC]) -AC_CHECK_PROG(CC, gcc, gcc) -if test -z "$CC"; then - AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) - test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -fi - -AC_PROG_CC_GNU - -if test $ac_cv_prog_gcc = yes; then - GCC=yes - ac_libiberty_warn_cflags='-W -Wall -Wtraditional' -dnl Check whether -g works, even if CFLAGS is set, in case the package -dnl plays around with CFLAGS (such as to build both debugging and -dnl normal versions of a library), tasteless as that idea is. - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - AC_PROG_CC_G - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-O2" - fi -else - GCC= - ac_libiberty_warn_cflags= - test "${CFLAGS+set}" = set || CFLAGS="-g" -fi -]) -AC_SUBST(ac_libiberty_warn_cflags) - -LIB_AC_PROG_CC - -AC_ISC_POSIX - -dnl When we start using libtool: -dnl Default to a non shared library. This may be overridden by the -dnl configure option --enable-shared. -dnl AM_DISABLE_SHARED - -dnl When we start using libtool: -dnl AM_PROG_LIBTOOL - -dnl When we start using automake: -dnl AM_CONFIG_HEADER(config.h:config.in) -AC_CONFIG_HEADER(config.h:config.in) - -dnl When we start using automake: -dnl AM_MAINTAINER_MODE -dnl AC_EXEEXT - -dnl When we start using automake: -dnl AM_PROG_INSTALL -AC_PROG_INSTALL - -. ${srcdir}/config.table -host_makefile_frag=${frag} -AC_SUBST_FILE(host_makefile_frag) - -# It's OK to check for header files. Although the compiler may not be -# able to link anything, it had better be able to at least compile -# something. -AC_CHECK_HEADERS(sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h sys/stat.h) -AC_HEADER_SYS_WAIT - -# This is the list of functions which libiberty will provide if they -# are not available on the host. - -funcs="asprintf" -funcs="$funcs atexit" -funcs="$funcs basename" -funcs="$funcs bcmp" -funcs="$funcs bcopy" -funcs="$funcs bzero" -funcs="$funcs calloc" -funcs="$funcs clock" -funcs="$funcs getcwd" -funcs="$funcs getpagesize" -funcs="$funcs index" -funcs="$funcs insque" -funcs="$funcs memchr" -funcs="$funcs memcmp" -funcs="$funcs memcpy" -funcs="$funcs memmove" -funcs="$funcs memset" -funcs="$funcs mkstemps" -funcs="$funcs putenv" -funcs="$funcs random" -funcs="$funcs rename" -funcs="$funcs rindex" -funcs="$funcs setenv" -funcs="$funcs sigsetmask" -funcs="$funcs strcasecmp" -funcs="$funcs strchr" -funcs="$funcs strdup" -funcs="$funcs strncasecmp" -funcs="$funcs strrchr" -funcs="$funcs strstr" -funcs="$funcs strtod" -funcs="$funcs strtol" -funcs="$funcs strtoul" -funcs="$funcs tmpnam" -funcs="$funcs vasprintf" -funcs="$funcs vfprintf" -funcs="$funcs vprintf" -funcs="$funcs vsprintf" -funcs="$funcs waitpid" - -# Also in the old function.def file: alloca, vfork, getopt. - -vars="sys_errlist sys_nerr sys_siglist" - -checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" - -# These are neither executed nor required, but they help keep -# autoheader happy without adding a bunch of text to acconfig.h. -if test "x" = "y"; then - AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bzero calloc clock getcwd) - AC_CHECK_FUNCS(getpagesize index insque mkstemps memchr memcmp memcpy memmove) - AC_CHECK_FUNCS(memset putenv random rename rindex sigsetmask strcasecmp) - AC_CHECK_FUNCS(setenv strchr strdup strncasecmp strrchr strstr strtod strtol) - AC_CHECK_FUNCS(strtoul tmpnam vasprintf vfprintf vprintf vsprintf waitpid) - AC_DEFINE(HAVE_SYS_ERRLIST) - AC_DEFINE(HAVE_SYS_NERR) - AC_DEFINE(HAVE_SYS_SIGLIST) - AC_CHECK_FUNCS(getrusage on_exit psignal strerror strsignal sysconf times) - AC_CHECK_FUNCS(sbrk gettimeofday) -fi - -# For each of these functions, if the host does not provide the -# function we want to put FN.o in LIBOBJS, and if the host does -# provide the function, we want to define HAVE_FN in config.h. Also, -# if the host does not provide alloca, we set ALLOCA to alloca.o - -setobjs= -CHECK= -if test -n "${with_target_subdir}"; then - - # We are being configured as a target library. AC_REPLACE_FUNCS - # may not work correctly, because the compiler may not be able to - # link executables. Note that we may still be being configured - # native. - - # If we are being configured for newlib, we know which functions - # newlib provide and which ones we will be expected to provide. - - if test "x${with_newlib}" = "xyes"; then - ALLOCA="alloca.o" - LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o" - - for f in $funcs; do - case "$f" in - asprintf | basename | insque | random | strdup | vasprintf) - ;; - *) - n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - AC_DEFINE_UNQUOTED($n) - ;; - esac - done - - # newlib doesnt provide any of the variables in $vars, so we - # dont have to check them here. - - # Of the functions in $checkfuncs, newlib only has strerror. - AC_DEFINE(HAVE_STRERROR) - - setobjs=yes - - fi - -else - - # Not a target library, so we set things up to run the test suite. - CHECK=check-cplus-dem - -fi - -AC_SUBST(CHECK) - -if test -z "${setobjs}"; then - case "${host}" in - - *-*-vxworks*) - # Handle VxWorks configuration specially, since on VxWorks the - # libraries are actually on the target board, not in the file - # system. - LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o" - LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o" - for f in $funcs; do - case "$f" in - basename | getpagesize | insque | random | strcasecmp) - ;; - strncasecmp | strdup | vfork | waitpid | vasprintf) - ;; - *) - n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - AC_DEFINE_UNQUOTED($n) - ;; - esac - done - - # VxWorks doesn't provide any of the variables in $vars, so we - # don't have to check them here. - - # Of the functions in $checkfuncs, VxWorks only has strerror. - AC_DEFINE(HAVE_STRERROR) - - setobjs=yes - ;; - - esac -fi - -if test -z "${setobjs}"; then - - case "${host}" in - - *-*-cygwin*) - # The Cygwin library actually uses a couple of files from - # libiberty when it is built. If we are building a native - # Cygwin, and we run the tests, we will appear to have these - # files. However, when we go on to build winsup, we will wind up - # with a library which does not have the files, since they should - # have come from libiberty. - - # We handle this by removing the functions the winsup library - # provides from our shell variables, so that they appear to be - # missing. - - funcs="`echo $funcs | sed -e 's/random//'`" - LIBOBJS="$LIBOBJS random.o" - vars="`echo $vars | sed -e 's/sys_siglist//'`" - checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`" - ;; - - *-*-mingw32*) - # Under mingw32, sys_nerr and sys_errlist exist, but they are - # macros, so the test below won't find them. - vars="`echo $vars | sed -e 's/sys_nerr//' -e 's/sys_errlist//'`" - AC_DEFINE(HAVE_SYS_NERR) - AC_DEFINE(HAVE_SYS_ERRLIST) - ;; - - *-*-uwin*) - # Under some versions of uwin, vfork is notoriously buggy and the test - # can hang configure; on other versions, vfork exists just as a stub. - # FIXME: This should be removed once vfork in uwin's runtime is fixed. - ac_cv_func_vfork_works=no - # Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are - # macros (actually, these are imported from a DLL, but the end effect - # is the same), so the test below won't find them. - AC_DEFINE(HAVE_SYS_NERR) - AC_DEFINE(HAVE_SYS_ERRLIST) - ;; - - esac - - # We haven't set the list of objects yet. Use the standard autoconf - # tests. This will only work if the compiler works. - AC_PROG_CC_WORKS - AC_REPLACE_FUNCS($funcs) - - case "${host}" in - *-*-interix) - # On Interix, it wrongly concludes that the MSVC compiler supports alloca. - # (MSVC does on Win32, not on Interix.) - # This should be temporary. - - ac_cv_header_alloca_h=no - ac_cv_func_alloca_works=no - ALLOCA=alloca.o - cat >> confdefs.h <<\EOF -#define C_ALLOCA 1 -EOF - cat >> confdefs.h <<EOF -#define STACK_DIRECTION -1 -EOF - ;; - *) - AC_FUNC_ALLOCA - ;; - esac - - AC_FUNC_VFORK - if test $ac_cv_func_vfork_works = no; then - LIBOBJS="$LIBOBJS vfork.o" - fi - for v in $vars; do - AC_MSG_CHECKING([for $v]) - AC_CACHE_VAL(libiberty_cv_var_$v, - [AC_TRY_LINK([int *p;], [extern int $v; p = &$v;], - [eval "libiberty_cv_var_$v=yes"], - [eval "libiberty_cv_var_$v=no"])]) - if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then - AC_MSG_RESULT(yes) - n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - AC_DEFINE_UNQUOTED($n) - else - AC_MSG_RESULT(no) - fi - done - AC_CHECK_FUNCS($checkfuncs) -fi - -# Install a library built with a cross compiler in $(tooldir) rather -# than $(libdir). -if test -z "${with_cross_host}"; then - INSTALL_DEST=libdir -else - INSTALL_DEST=tooldir -fi -AC_SUBST(INSTALL_DEST) - -# We need multilib support, but only if configuring for the target. -AC_OUTPUT(Makefile testsuite/Makefile, -[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h -if test -n "$CONFIG_FILES"; then - if test -n "${with_target_subdir}"; then - # FIXME: We shouldn't need to set ac_file - ac_file=Makefile - . ${libiberty_topdir}/config-ml.in - fi -fi], -srcdir=${srcdir} -host=${host} -target=${target} -with_target_subdir=${with_target_subdir} -with_multisubdir=${with_multisubdir} -ac_configure_args="--enable-multilib ${ac_configure_args}" -CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -libiberty_topdir=${libiberty_topdir} -) diff --git a/gnu/egcs/libiberty/copysign.c b/gnu/egcs/libiberty/copysign.c deleted file mode 100644 index 0b5f8c3d9df..00000000000 --- a/gnu/egcs/libiberty/copysign.c +++ /dev/null @@ -1,140 +0,0 @@ -#include <ansidecl.h> - -#ifdef __IEEE_BIG_ENDIAN - -typedef union -{ - double value; - struct - { - unsigned int sign : 1; - unsigned int exponent: 11; - unsigned int fraction0:4; - unsigned int fraction1:16; - unsigned int fraction2:16; - unsigned int fraction3:16; - - } number; - struct - { - unsigned int sign : 1; - unsigned int exponent: 11; - unsigned int quiet:1; - unsigned int function0:3; - unsigned int function1:16; - unsigned int function2:16; - unsigned int function3:16; - } nan; - struct - { - unsigned long msw; - unsigned long lsw; - } parts; - long aslong[2]; -} __ieee_double_shape_type; - -#endif - -#ifdef __IEEE_LITTLE_ENDIAN - -typedef union -{ - double value; - struct - { -#ifdef __SMALL_BITFIELDS - unsigned int fraction3:16; - unsigned int fraction2:16; - unsigned int fraction1:16; - unsigned int fraction0: 4; -#else - unsigned int fraction1:32; - unsigned int fraction0:20; -#endif - unsigned int exponent :11; - unsigned int sign : 1; - } number; - struct - { -#ifdef __SMALL_BITFIELDS - unsigned int function3:16; - unsigned int function2:16; - unsigned int function1:16; - unsigned int function0:3; -#else - unsigned int function1:32; - unsigned int function0:19; -#endif - unsigned int quiet:1; - unsigned int exponent: 11; - unsigned int sign : 1; - } nan; - struct - { - unsigned long lsw; - unsigned long msw; - } parts; - - long aslong[2]; - -} __ieee_double_shape_type; - -#endif - -#ifdef __IEEE_BIG_ENDIAN -typedef union -{ - float value; - struct - { - unsigned int sign : 1; - unsigned int exponent: 8; - unsigned int fraction0: 7; - unsigned int fraction1: 16; - } number; - struct - { - unsigned int sign:1; - unsigned int exponent:8; - unsigned int quiet:1; - unsigned int function0:6; - unsigned int function1:16; - } nan; - long p1; - -} __ieee_float_shape_type; -#endif - -#ifdef __IEEE_LITTLE_ENDIAN -typedef union -{ - float value; - struct - { - unsigned int fraction0: 7; - unsigned int fraction1: 16; - unsigned int exponent: 8; - unsigned int sign : 1; - } number; - struct - { - unsigned int function1:16; - unsigned int function0:6; - unsigned int quiet:1; - unsigned int exponent:8; - unsigned int sign:1; - } nan; - long p1; - -} __ieee_float_shape_type; -#endif - - -double DEFUN(copysign, (x, y), double x AND double y) -{ - __ieee_double_shape_type a,b; - b.value = y; - a.value = x; - a.number.sign =b.number.sign; - return a.value; -} diff --git a/gnu/egcs/libiberty/cp-demangle.c b/gnu/egcs/libiberty/cp-demangle.c deleted file mode 100644 index 1cc4847d4e7..00000000000 --- a/gnu/egcs/libiberty/cp-demangle.c +++ /dev/null @@ -1,3834 +0,0 @@ -/* Demangler for IA64 / g++ V3 ABI. - Copyright (C) 2000 Free Software Foundation, Inc. - Written by Alex Samuel <samuel@codesourcery.com>. - - This file is part of GNU CC. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* This file implements demangling of C++ names mangled according to - the IA64 / g++ V3 ABI. Use the cp_demangle function to - demangle a mangled name, or compile with the preprocessor macro - STANDALONE_DEMANGLER defined to create a demangling filter - executable (functionally similar to c++filt, but includes this - demangler only). */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/types.h> - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#include <stdio.h> - -#ifdef HAVE_STRING_H -#include <string.h> -#endif - -#include "ansidecl.h" -#include "libiberty.h" -#include "dyn-string.h" -#include "demangle.h" - -/* If CP_DEMANGLE_DEBUG is defined, a trace of the grammar evaluation, - and other debugging output, will be generated. */ -#ifdef CP_DEMANGLE_DEBUG -#define DEMANGLE_TRACE(PRODUCTION, DM) \ - fprintf (stderr, " -> %-24s at position %3d\n", \ - (PRODUCTION), current_position (DM)); -#else -#define DEMANGLE_TRACE(PRODUCTION, DM) -#endif - -/* Don't include <ctype.h>, to prevent additional unresolved symbols - from being dragged into the C++ runtime library. */ -#define IS_DIGIT(CHAR) ((CHAR) >= '0' && (CHAR) <= '9') -#define IS_ALPHA(CHAR) \ - (((CHAR) >= 'a' && (CHAR) <= 'z') \ - || ((CHAR) >= 'A' && (CHAR) <= 'Z')) - -/* The prefix prepended by GCC to an identifier represnting the - anonymous namespace. */ -#define ANONYMOUS_NAMESPACE_PREFIX "_GLOBAL_" - -/* If flag_verbose is zero, some simplifications will be made to the - output to make it easier to read and supress details that are - generally not of interest to the average C++ programmer. - Otherwise, the demangled representation will attempt to convey as - much information as the mangled form. */ -static int flag_verbose; - -/* If flag_strict is non-zero, demangle strictly according to the - specification -- don't demangle special g++ manglings. */ -static int flag_strict; - -/* String_list_t is an extended form of dyn_string_t which provides a - link field and a caret position for additions to the string. A - string_list_t may safely be cast to and used as a dyn_string_t. */ - -struct string_list_def -{ - /* The dyn_string; must be first. */ - struct dyn_string string; - - /* The position at which additional text is added to this string - (using the result_add* macros). This value is an offset from the - end of the string, not the beginning (and should be - non-positive). */ - int caret_position; - - /* The next string in the list. */ - struct string_list_def *next; -}; - -typedef struct string_list_def *string_list_t; - -/* Data structure representing a potential substitution. */ - -struct substitution_def -{ - /* The demangled text of the substitution. */ - dyn_string_t text; - - /* Whether this substitution represents a template item. */ - int template_p : 1; -}; - -/* Data structure representing a template argument list. */ - -struct template_arg_list_def -{ - /* The next (lower) template argument list in the stack of currently - active template arguments. */ - struct template_arg_list_def *next; - - /* The first element in the list of template arguments in - left-to-right order. */ - string_list_t first_argument; - - /* The last element in the arguments lists. */ - string_list_t last_argument; -}; - -typedef struct template_arg_list_def *template_arg_list_t; - -/* Data structure to maintain the state of the current demangling. */ - -struct demangling_def -{ - /* The full mangled name being mangled. */ - const char *name; - - /* Pointer into name at the current position. */ - const char *next; - - /* Stack for strings containing demangled result generated so far. - Text is emitted to the topmost (first) string. */ - string_list_t result; - - /* The number of presently available substitutions. */ - int num_substitutions; - - /* The allocated size of the substitutions array. */ - int substitutions_allocated; - - /* An array of available substitutions. The number of elements in - the array is given by num_substitions, and the allocated array - size in substitutions_size. - - The most recent substition is at the end, so - - - `S_' corresponds to substititutions[num_substitutions - 1] - - `S0_' corresponds to substititutions[num_substitutions - 2] - - etc. */ - struct substitution_def *substitutions; - - /* The stack of template argument lists. */ - template_arg_list_t template_arg_lists; - - /* The most recently demangled source-name. */ - dyn_string_t last_source_name; -}; - -typedef struct demangling_def *demangling_t; - -/* This type is the standard return code from most functions. Values - other than STATUS_OK contain descriptive messages. */ -typedef const char *status_t; - -/* Special values that can be used as a status_t. */ -#define STATUS_OK NULL -#define STATUS_ERROR "Error." -#define STATUS_UNIMPLEMENTED "Unimplemented." -#define STATUS_INTERNAL_ERROR "Internal error." - -/* This status code indicates a failure in malloc or realloc. */ -static const char *const status_allocation_failed = "Allocation failed."; -#define STATUS_ALLOCATION_FAILED status_allocation_failed - -/* Non-zero if STATUS indicates that no error has occurred. */ -#define STATUS_NO_ERROR(STATUS) ((STATUS) == STATUS_OK) - -/* Evaluate EXPR, which must produce a status_t. If the status code - indicates an error, return from the current function with that - status code. */ -#define RETURN_IF_ERROR(EXPR) \ - do \ - { \ - status_t s = EXPR; \ - if (!STATUS_NO_ERROR (s)) \ - return s; \ - } \ - while (0) - -static status_t int_to_dyn_string - PARAMS ((int, dyn_string_t)); -static string_list_t string_list_new - PARAMS ((int)); -static void string_list_delete - PARAMS ((string_list_t)); -static status_t result_add_separated_char - PARAMS ((demangling_t, int)); -static status_t result_push - PARAMS ((demangling_t)); -static string_list_t result_pop - PARAMS ((demangling_t)); -static int substitution_start - PARAMS ((demangling_t)); -static status_t substitution_add - PARAMS ((demangling_t, int, int)); -static dyn_string_t substitution_get - PARAMS ((demangling_t, int, int *)); -#ifdef CP_DEMANGLE_DEBUG -static void substitutions_print - PARAMS ((demangling_t, FILE *)); -#endif -static template_arg_list_t template_arg_list_new - PARAMS ((void)); -static void template_arg_list_delete - PARAMS ((template_arg_list_t)); -static void template_arg_list_add_arg - PARAMS ((template_arg_list_t, string_list_t)); -static string_list_t template_arg_list_get_arg - PARAMS ((template_arg_list_t, int)); -static void push_template_arg_list - PARAMS ((demangling_t, template_arg_list_t)); -static void pop_to_template_arg_list - PARAMS ((demangling_t, template_arg_list_t)); -#ifdef CP_DEMANGLE_DEBUG -static void template_arg_list_print - PARAMS ((template_arg_list_t, FILE *)); -#endif -static template_arg_list_t current_template_arg_list - PARAMS ((demangling_t)); -static demangling_t demangling_new - PARAMS ((const char *)); -static void demangling_delete - PARAMS ((demangling_t)); - -/* The last character of DS. Warning: DS is evaluated twice. */ -#define dyn_string_last_char(DS) \ - (dyn_string_buf (DS)[dyn_string_length (DS) - 1]) - -/* Append a space character (` ') to DS if it does not already end - with one. Evaluates to 1 on success, or 0 on allocation failure. */ -#define dyn_string_append_space(DS) \ - ((dyn_string_length (DS) > 0 \ - && dyn_string_last_char (DS) != ' ') \ - ? dyn_string_append_char ((DS), ' ') \ - : 1) - -/* Returns the index of the current position in the mangled name. */ -#define current_position(DM) ((DM)->next - (DM)->name) - -/* Returns the character at the current position of the mangled name. */ -#define peek_char(DM) (*((DM)->next)) - -/* Returns the character one past the current position of the mangled - name. */ -#define peek_char_next(DM) \ - (peek_char (DM) == '\0' ? '\0' : (*((DM)->next + 1))) - -/* Returns the character at the current position, and advances the - current position to the next character. */ -#define next_char(DM) (*((DM)->next)++) - -/* Returns non-zero if the current position is the end of the mangled - name, i.e. one past the last character. */ -#define end_of_name_p(DM) (peek_char (DM) == '\0') - -/* Advances the current position by one character. */ -#define advance_char(DM) (++(DM)->next) - -/* Returns the string containing the current demangled result. */ -#define result_string(DM) (&(DM)->result->string) - -/* Returns the position at which new text is inserted into the - demangled result. */ -#define result_caret_pos(DM) \ - (result_length (DM) + \ - ((string_list_t) result_string (DM))->caret_position) - -/* Adds a dyn_string_t to the demangled result. */ -#define result_add_string(DM, STRING) \ - (dyn_string_insert (&(DM)->result->string, \ - result_caret_pos (DM), (STRING)) \ - ? STATUS_OK : STATUS_ALLOCATION_FAILED) - -/* Adds NUL-terminated string CSTR to the demangled result. */ -#define result_add(DM, CSTR) \ - (dyn_string_insert_cstr (&(DM)->result->string, \ - result_caret_pos (DM), (CSTR)) \ - ? STATUS_OK : STATUS_ALLOCATION_FAILED) - -/* Adds character CHAR to the demangled result. */ -#define result_add_char(DM, CHAR) \ - (dyn_string_insert_char (&(DM)->result->string, \ - result_caret_pos (DM), (CHAR)) \ - ? STATUS_OK : STATUS_ALLOCATION_FAILED) - -/* Inserts a dyn_string_t to the demangled result at position POS. */ -#define result_insert_string(DM, POS, STRING) \ - (dyn_string_insert (&(DM)->result->string, (POS), (STRING)) \ - ? STATUS_OK : STATUS_ALLOCATION_FAILED) - -/* Inserts NUL-terminated string CSTR to the demangled result at - position POS. */ -#define result_insert(DM, POS, CSTR) \ - (dyn_string_insert_cstr (&(DM)->result->string, (POS), (CSTR)) \ - ? STATUS_OK : STATUS_ALLOCATION_FAILED) - -/* Inserts character CHAR to the demangled result at position POS. */ -#define result_insert_char(DM, POS, CHAR) \ - (dyn_string_insert_char (&(DM)->result->string, (POS), (CHAR)) \ - ? STATUS_OK : STATUS_ALLOCATION_FAILED) - -/* The length of the current demangled result. */ -#define result_length(DM) \ - dyn_string_length (&(DM)->result->string) - -/* Appends a (less-than, greater-than) character to the result in DM - to (open, close) a template argument or parameter list. Appends a - space first if necessary to prevent spurious elision of angle - brackets with the previous character. */ -#define result_open_template_list(DM) result_add_separated_char(DM, '<') -#define result_close_template_list(DM) result_add_separated_char(DM, '>') - -/* Appends a base 10 representation of VALUE to DS. STATUS_OK on - success. On failure, deletes DS and returns an error code. */ - -static status_t -int_to_dyn_string (value, ds) - int value; - dyn_string_t ds; -{ - int i; - int mask = 1; - - /* Handle zero up front. */ - if (value == 0) - { - if (!dyn_string_append_char (ds, '0')) - return STATUS_ALLOCATION_FAILED; - return STATUS_OK; - } - - /* For negative numbers, emit a minus sign. */ - if (value < 0) - { - if (!dyn_string_append_char (ds, '-')) - return STATUS_ALLOCATION_FAILED; - value = -value; - } - - /* Find the power of 10 of the first digit. */ - i = value; - while (i > 9) - { - mask *= 10; - i /= 10; - } - - /* Write the digits. */ - while (mask > 0) - { - int digit = value / mask; - - if (!dyn_string_append_char (ds, '0' + digit)) - return STATUS_ALLOCATION_FAILED; - - value -= digit * mask; - mask /= 10; - } - - return STATUS_OK; -} - -/* Creates a new string list node. The contents of the string are - empty, but the initial buffer allocation is LENGTH. The string - list node should be deleted with string_list_delete. Returns NULL - if allocation fails. */ - -static string_list_t -string_list_new (length) - int length; -{ - string_list_t s = (string_list_t) malloc (sizeof (struct string_list_def)); - s->caret_position = 0; - if (s == NULL) - return NULL; - if (!dyn_string_init ((dyn_string_t) s, length)) - return NULL; - return s; -} - -/* Deletes the entire string list starting at NODE. */ - -static void -string_list_delete (node) - string_list_t node; -{ - while (node != NULL) - { - string_list_t next = node->next; - free (node); - node = next; - } -} - -/* Appends CHARACTER to the demangled result. If the current trailing - character of the result is CHARACTER, a space is inserted first. */ - -static status_t -result_add_separated_char (dm, character) - demangling_t dm; - int character; -{ - char *result = dyn_string_buf (result_string (dm)); - int caret_pos = result_caret_pos (dm); - - /* Add a space if the last character is already the character we - want to add. */ - if (caret_pos > 0 && result[caret_pos - 1] == character) - RETURN_IF_ERROR (result_add_char (dm, ' ')); - /* Add the character. */ - RETURN_IF_ERROR (result_add_char (dm, character)); - - return STATUS_OK; -} - -/* Allocates and pushes a new string onto the demangled results stack - for DM. Subsequent demangling with DM will emit to the new string. - Returns STATUS_OK on success, STATUS_ALLOCATION_FAILED on - allocation failure. */ - -static status_t -result_push (dm) - demangling_t dm; -{ - string_list_t new_string = string_list_new (0); - if (new_string == NULL) - /* Allocation failed. */ - return STATUS_ALLOCATION_FAILED; - - /* Link the new string to the front of the list of result strings. */ - new_string->next = (string_list_t) dm->result; - dm->result = new_string; - return STATUS_OK; -} - -/* Removes and returns the topmost element on the demangled results - stack for DM. The caller assumes ownership for the returned - string. */ - -static string_list_t -result_pop (dm) - demangling_t dm; -{ - string_list_t top = dm->result; - dm->result = top->next; - return top; -} - -/* Returns the current value of the caret for the result string. The - value is an offet from the end of the result string. */ - -static int -result_get_caret (dm) - demangling_t dm; -{ - return ((string_list_t) result_string (dm))->caret_position; -} - -/* Sets the value of the caret for the result string, counted as an - offet from the end of the result string. */ - -static void -result_set_caret (dm, position) - demangling_t dm; - int position; -{ - ((string_list_t) result_string (dm))->caret_position = position; -} - -/* Shifts the position of the next addition to the result by - POSITION_OFFSET. A negative value shifts the caret to the left. */ - -static void -result_shift_caret (dm, position_offset) - demangling_t dm; - int position_offset; -{ - ((string_list_t) result_string (dm))->caret_position += position_offset; -} - -/* Returns non-zero if the character that comes right before the place - where text will be added to the result is a space. In this case, - the caller should supress adding another space. */ - -static int -result_previous_char_is_space (dm) - demangling_t dm; -{ - char *result = dyn_string_buf (result_string (dm)); - int pos = result_caret_pos (dm); - return pos > 0 && result[pos - 1] == ' '; -} - -/* Returns the start position of a fragment of the demangled result - that will be a substitution candidate. Should be called at the - start of productions that can add substitutions. */ - -static int -substitution_start (dm) - demangling_t dm; -{ - return result_caret_pos (dm); -} - -/* Adds the suffix of the current demangled result of DM starting at - START_POSITION as a potential substitution. If TEMPLATE_P is - non-zero, this potential substitution is a template-id. */ - -static status_t -substitution_add (dm, start_position, template_p) - demangling_t dm; - int start_position; - int template_p; -{ - dyn_string_t result = result_string (dm); - dyn_string_t substitution = dyn_string_new (0); - int i; - - if (substitution == NULL) - return STATUS_ALLOCATION_FAILED; - - /* Extract the substring of the current demangling result that - represents the subsitution candidate. */ - if (!dyn_string_substring (substitution, - result, start_position, result_caret_pos (dm))) - { - dyn_string_delete (substitution); - return STATUS_ALLOCATION_FAILED; - } - - /* If there's no room for the new entry, grow the array. */ - if (dm->substitutions_allocated == dm->num_substitutions) - { - size_t new_array_size; - if (dm->substitutions_allocated > 0) - dm->substitutions_allocated *= 2; - else - dm->substitutions_allocated = 2; - new_array_size = - sizeof (struct substitution_def) * dm->substitutions_allocated; - - dm->substitutions = (struct substitution_def *) - realloc (dm->substitutions, new_array_size); - if (dm->substitutions == NULL) - /* Realloc failed. */ - { - dyn_string_delete (substitution); - return STATUS_ALLOCATION_FAILED; - } - } - - /* Add the substitution to the array. */ - i = dm->num_substitutions++; - dm->substitutions[i].text = substitution; - dm->substitutions[i].template_p = template_p; - -#ifdef CP_DEMANGLE_DEBUG - substitutions_print (dm, stderr); -#endif - - return STATUS_OK; -} - -/* Returns the Nth-most-recent substitution. Sets *TEMPLATE_P to - non-zero if the substitution is a template-id, zero otherwise. - N is numbered from zero. DM retains ownership of the returned - string. If N is negative, or equal to or greater than the current - number of substitution candidates, returns NULL. */ - -static dyn_string_t -substitution_get (dm, n, template_p) - demangling_t dm; - int n; - int *template_p; -{ - struct substitution_def *sub; - - /* Make sure N is in the valid range. */ - if (n < 0 || n >= dm->num_substitutions) - return NULL; - - sub = &(dm->substitutions[n]); - *template_p = sub->template_p; - return sub->text; -} - -#ifdef CP_DEMANGLE_DEBUG -/* Debugging routine to print the current substitutions to FP. */ - -static void -substitutions_print (dm, fp) - demangling_t dm; - FILE *fp; -{ - int seq_id; - int num = dm->num_substitutions; - - fprintf (fp, "SUBSTITUTIONS:\n"); - for (seq_id = -1; seq_id < num - 1; ++seq_id) - { - int template_p; - dyn_string_t text = substitution_get (dm, seq_id + 1, &template_p); - - if (seq_id == -1) - fprintf (fp, " S_ "); - else - fprintf (fp, " S%d_", seq_id); - fprintf (fp, " %c: %s\n", template_p ? '*' : ' ', dyn_string_buf (text)); - } -} - -#endif /* CP_DEMANGLE_DEBUG */ - -/* Creates a new template argument list. Returns NULL if allocation - fails. */ - -static template_arg_list_t -template_arg_list_new () -{ - template_arg_list_t new_list = - (template_arg_list_t) malloc (sizeof (struct template_arg_list_def)); - if (new_list == NULL) - return NULL; - /* Initialize the new list to have no arguments. */ - new_list->first_argument = NULL; - new_list->last_argument = NULL; - /* Return the new list. */ - return new_list; -} - -/* Deletes a template argument list and the template arguments it - contains. */ - -static void -template_arg_list_delete (list) - template_arg_list_t list; -{ - /* If there are any arguments on LIST, delete them. */ - if (list->first_argument != NULL) - string_list_delete (list->first_argument); - /* Delete LIST. */ - free (list); -} - -/* Adds ARG to the template argument list ARG_LIST. */ - -static void -template_arg_list_add_arg (arg_list, arg) - template_arg_list_t arg_list; - string_list_t arg; -{ - if (arg_list->first_argument == NULL) - /* If there were no arguments before, ARG is the first one. */ - arg_list->first_argument = arg; - else - /* Make ARG the last argument on the list. */ - arg_list->last_argument->next = arg; - /* Make ARG the last on the list. */ - arg_list->last_argument = arg; - arg->next = NULL; -} - -/* Returns the template arugment at position INDEX in template - argument list ARG_LIST. */ - -static string_list_t -template_arg_list_get_arg (arg_list, index) - template_arg_list_t arg_list; - int index; -{ - string_list_t arg = arg_list->first_argument; - /* Scan down the list of arguments to find the one at position - INDEX. */ - while (index--) - { - arg = arg->next; - if (arg == NULL) - /* Ran out of arguments before INDEX hit zero. That's an - error. */ - return NULL; - } - /* Return the argument at position INDEX. */ - return arg; -} - -/* Pushes ARG_LIST onto the top of the template argument list stack. */ - -static void -push_template_arg_list (dm, arg_list) - demangling_t dm; - template_arg_list_t arg_list; -{ - arg_list->next = dm->template_arg_lists; - dm->template_arg_lists = arg_list; -#ifdef CP_DEMANGLE_DEBUG - fprintf (stderr, " ** pushing template arg list\n"); - template_arg_list_print (arg_list, stderr); -#endif -} - -/* Pops and deletes elements on the template argument list stack until - arg_list is the topmost element. If arg_list is NULL, all elements - are popped and deleted. */ - -static void -pop_to_template_arg_list (dm, arg_list) - demangling_t dm; - template_arg_list_t arg_list; -{ - while (dm->template_arg_lists != arg_list) - { - template_arg_list_t top = dm->template_arg_lists; - /* Disconnect the topmost element from the list. */ - dm->template_arg_lists = top->next; - /* Delete the popped element. */ - template_arg_list_delete (top); -#ifdef CP_DEMANGLE_DEBUG - fprintf (stderr, " ** removing template arg list\n"); -#endif - } -} - -#ifdef CP_DEMANGLE_DEBUG - -/* Prints the contents of ARG_LIST to FP. */ - -static void -template_arg_list_print (arg_list, fp) - template_arg_list_t arg_list; - FILE *fp; -{ - string_list_t arg; - int index = -1; - - fprintf (fp, "TEMPLATE ARGUMENT LIST:\n"); - for (arg = arg_list->first_argument; arg != NULL; arg = arg->next) - { - if (index == -1) - fprintf (fp, " T_ : "); - else - fprintf (fp, " T%d_ : ", index); - ++index; - fprintf (fp, "%s\n", dyn_string_buf ((dyn_string_t) arg)); - } -} - -#endif /* CP_DEMANGLE_DEBUG */ - -/* Returns the topmost element on the stack of template argument - lists. If there is no list of template arguments, returns NULL. */ - -static template_arg_list_t -current_template_arg_list (dm) - demangling_t dm; -{ - return dm->template_arg_lists; -} - -/* Allocates a demangling_t object for demangling mangled NAME. A new - result must be pushed before the returned object can be used. - Returns NULL if allocation fails. */ - -static demangling_t -demangling_new (name) - const char *name; -{ - demangling_t dm; - dm = (demangling_t) malloc (sizeof (struct demangling_def)); - if (dm == NULL) - return NULL; - - dm->name = name; - dm->next = name; - dm->result = NULL; - dm->num_substitutions = 0; - dm->substitutions_allocated = 10; - dm->template_arg_lists = NULL; - dm->last_source_name = dyn_string_new (0); - if (dm->last_source_name == NULL) - return NULL; - dm->substitutions = (struct substitution_def *) - malloc (dm->substitutions_allocated * sizeof (struct substitution_def)); - if (dm->substitutions == NULL) - { - dyn_string_delete (dm->last_source_name); - return NULL; - } - - return dm; -} - -/* Deallocates a demangling_t object and all memory associated with - it. */ - -static void -demangling_delete (dm) - demangling_t dm; -{ - int i; - template_arg_list_t arg_list = dm->template_arg_lists; - - /* Delete the stack of template argument lists. */ - while (arg_list != NULL) - { - template_arg_list_t next = arg_list->next; - template_arg_list_delete (arg_list); - arg_list = next; - } - /* Delete the list of substitutions. */ - for (i = dm->num_substitutions; --i >= 0; ) - dyn_string_delete (dm->substitutions[i].text); - free (dm->substitutions); - /* Delete the demangled result. */ - string_list_delete (dm->result); - /* Delete the stored identifier name. */ - dyn_string_delete (dm->last_source_name); - /* Delete the context object itself. */ - free (dm); -} - -/* These functions demangle an alternative of the corresponding - production in the mangling spec. The first argument of each is a - demangling context structure for the current demangling - operation. Most emit demangled text directly to the topmost result - string on the result string stack in the demangling context - structure. */ - -static status_t demangle_char - PARAMS ((demangling_t, int)); -static status_t demangle_mangled_name - PARAMS ((demangling_t)); -static status_t demangle_encoding - PARAMS ((demangling_t)); -static status_t demangle_name - PARAMS ((demangling_t, int *)); -static status_t demangle_nested_name - PARAMS ((demangling_t, int *)); -static status_t demangle_prefix - PARAMS ((demangling_t, int *)); -static status_t demangle_unqualified_name - PARAMS ((demangling_t, int *)); -static status_t demangle_source_name - PARAMS ((demangling_t)); -static status_t demangle_number - PARAMS ((demangling_t, int *, int, int)); -static status_t demangle_number_literally - PARAMS ((demangling_t, dyn_string_t, int, int)); -static status_t demangle_identifier - PARAMS ((demangling_t, int, dyn_string_t)); -static status_t demangle_operator_name - PARAMS ((demangling_t, int, int *)); -static status_t demangle_nv_offset - PARAMS ((demangling_t)); -static status_t demangle_v_offset - PARAMS ((demangling_t)); -static status_t demangle_call_offset - PARAMS ((demangling_t)); -static status_t demangle_special_name - PARAMS ((demangling_t)); -static status_t demangle_ctor_dtor_name - PARAMS ((demangling_t)); -static status_t demangle_type_ptr - PARAMS ((demangling_t, int *, int)); -static status_t demangle_type - PARAMS ((demangling_t)); -static status_t demangle_CV_qualifiers - PARAMS ((demangling_t, dyn_string_t)); -static status_t demangle_builtin_type - PARAMS ((demangling_t)); -static status_t demangle_function_type - PARAMS ((demangling_t, int *)); -static status_t demangle_bare_function_type - PARAMS ((demangling_t, int *)); -static status_t demangle_class_enum_type - PARAMS ((demangling_t, int *)); -static status_t demangle_array_type - PARAMS ((demangling_t, int *)); -static status_t demangle_template_param - PARAMS ((demangling_t)); -static status_t demangle_template_args - PARAMS ((demangling_t)); -static status_t demangle_literal - PARAMS ((demangling_t)); -static status_t demangle_template_arg - PARAMS ((demangling_t)); -static status_t demangle_expression - PARAMS ((demangling_t)); -static status_t demangle_scope_expression - PARAMS ((demangling_t)); -static status_t demangle_expr_primary - PARAMS ((demangling_t)); -static status_t demangle_substitution - PARAMS ((demangling_t, int *)); -static status_t demangle_local_name - PARAMS ((demangling_t)); -static status_t demangle_discriminator - PARAMS ((demangling_t, int)); -static status_t cp_demangle - PARAMS ((const char *, dyn_string_t)); -#ifdef IN_LIBGCC2 -static status_t cp_demangle_type - PARAMS ((const char*, dyn_string_t)); -#endif - -/* When passed to demangle_bare_function_type, indicates that the - function's return type is not encoded before its parameter types. */ -#define BFT_NO_RETURN_TYPE NULL - -/* Check that the next character is C. If so, consume it. If not, - return an error. */ - -static status_t -demangle_char (dm, c) - demangling_t dm; - int c; -{ - static char *error_message = NULL; - - if (peek_char (dm) == c) - { - advance_char (dm); - return STATUS_OK; - } - else - { - if (error_message == NULL) - error_message = strdup ("Expected ?"); - error_message[9] = c; - return error_message; - } -} - -/* Demangles and emits a <mangled-name>. - - <mangled-name> ::= _Z <encoding> */ - -static status_t -demangle_mangled_name (dm) - demangling_t dm; -{ - DEMANGLE_TRACE ("mangled-name", dm); - RETURN_IF_ERROR (demangle_char (dm, '_')); - RETURN_IF_ERROR (demangle_char (dm, 'Z')); - RETURN_IF_ERROR (demangle_encoding (dm)); - return STATUS_OK; -} - -/* Demangles and emits an <encoding>. - - <encoding> ::= <function name> <bare-function-type> - ::= <data name> - ::= <special-name> */ - -static status_t -demangle_encoding (dm) - demangling_t dm; -{ - int encode_return_type; - int start_position; - template_arg_list_t old_arg_list = current_template_arg_list (dm); - char peek = peek_char (dm); - - DEMANGLE_TRACE ("encoding", dm); - - /* Remember where the name starts. If it turns out to be a template - function, we'll have to insert the return type here. */ - start_position = result_caret_pos (dm); - - if (peek == 'G' || peek == 'T') - RETURN_IF_ERROR (demangle_special_name (dm)); - else - { - /* Now demangle the name. */ - RETURN_IF_ERROR (demangle_name (dm, &encode_return_type)); - - /* If there's anything left, the name was a function name, with - maybe its return type, and its parameter types, following. */ - if (!end_of_name_p (dm) - && peek_char (dm) != 'E') - { - if (encode_return_type) - /* Template functions have their return type encoded. The - return type should be inserted at start_position. */ - RETURN_IF_ERROR - (demangle_bare_function_type (dm, &start_position)); - else - /* Non-template functions don't have their return type - encoded. */ - RETURN_IF_ERROR - (demangle_bare_function_type (dm, BFT_NO_RETURN_TYPE)); - } - } - - /* Pop off template argument lists that were built during the - mangling of this name, to restore the old template context. */ - pop_to_template_arg_list (dm, old_arg_list); - - return STATUS_OK; -} - -/* Demangles and emits a <name>. - - <name> ::= <unscoped-name> - ::= <unscoped-template-name> <template-args> - ::= <nested-name> - ::= <local-name> - - <unscoped-name> ::= <unqualified-name> - ::= St <unqualified-name> # ::std:: - - <unscoped-template-name> - ::= <unscoped-name> - ::= <substitution> */ - -static status_t -demangle_name (dm, encode_return_type) - demangling_t dm; - int *encode_return_type; -{ - int start = substitution_start (dm); - char peek = peek_char (dm); - int is_std_substitution = 0; - - /* Generally, the return type is encoded if the function is a - template-id, and suppressed otherwise. There are a few cases, - though, in which the return type is not encoded even for a - templated function. In these cases, this flag is set. */ - int suppress_return_type = 0; - - DEMANGLE_TRACE ("name", dm); - - switch (peek) - { - case 'N': - /* This is a <nested-name>. */ - RETURN_IF_ERROR (demangle_nested_name (dm, encode_return_type)); - break; - - case 'Z': - RETURN_IF_ERROR (demangle_local_name (dm)); - *encode_return_type = 0; - break; - - case 'S': - /* The `St' substitution allows a name nested in std:: to appear - without being enclosed in a nested name. */ - if (peek_char_next (dm) == 't') - { - (void) next_char (dm); - (void) next_char (dm); - RETURN_IF_ERROR (result_add (dm, "std::")); - RETURN_IF_ERROR - (demangle_unqualified_name (dm, &suppress_return_type)); - is_std_substitution = 1; - } - else - RETURN_IF_ERROR (demangle_substitution (dm, encode_return_type)); - /* Check if a template argument list immediately follows. - If so, then we just demangled an <unqualified-template-name>. */ - if (peek_char (dm) == 'I') - { - /* A template name of the form std::<unqualified-name> is a - substitution candidate. */ - if (is_std_substitution) - RETURN_IF_ERROR (substitution_add (dm, start, 0)); - /* Demangle the <template-args> here. */ - RETURN_IF_ERROR (demangle_template_args (dm)); - *encode_return_type = !suppress_return_type; - } - else - *encode_return_type = 0; - - break; - - default: - /* This is an <unscoped-name> or <unscoped-template-name>. */ - RETURN_IF_ERROR (demangle_unqualified_name (dm, &suppress_return_type)); - - /* If the <unqualified-name> is followed by template args, this - is an <unscoped-template-name>. */ - if (peek_char (dm) == 'I') - { - /* Add a substitution for the unqualified template name. */ - RETURN_IF_ERROR (substitution_add (dm, start, 0)); - - RETURN_IF_ERROR (demangle_template_args (dm)); - *encode_return_type = !suppress_return_type; - } - else - *encode_return_type = 0; - - break; - } - - return STATUS_OK; -} - -/* Demangles and emits a <nested-name>. - - <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqulified-name> E */ - -static status_t -demangle_nested_name (dm, encode_return_type) - demangling_t dm; - int *encode_return_type; -{ - char peek; - - DEMANGLE_TRACE ("nested-name", dm); - - RETURN_IF_ERROR (demangle_char (dm, 'N')); - - peek = peek_char (dm); - if (peek == 'r' || peek == 'V' || peek == 'K') - { - dyn_string_t cv_qualifiers; - status_t status; - - /* Snarf up CV qualifiers. */ - cv_qualifiers = dyn_string_new (24); - if (cv_qualifiers == NULL) - return STATUS_ALLOCATION_FAILED; - demangle_CV_qualifiers (dm, cv_qualifiers); - - /* Emit them, preceded by a space. */ - status = result_add_char (dm, ' '); - if (STATUS_NO_ERROR (status)) - status = result_add_string (dm, cv_qualifiers); - /* The CV qualifiers that occur in a <nested-name> will be - qualifiers for member functions. These are placed at the end - of the function. Therefore, shift the caret to the left by - the length of the qualifiers, so other text is inserted - before them and they stay at the end. */ - result_shift_caret (dm, -dyn_string_length (cv_qualifiers) - 1); - /* Clean up. */ - dyn_string_delete (cv_qualifiers); - RETURN_IF_ERROR (status); - } - - RETURN_IF_ERROR (demangle_prefix (dm, encode_return_type)); - /* No need to demangle the final <unqualified-name>; demangle_prefix - will handle it. */ - RETURN_IF_ERROR (demangle_char (dm, 'E')); - - return STATUS_OK; -} - -/* Demangles and emits a <prefix>. - - <prefix> ::= <prefix> <unqualified-name> - ::= <template-prefix> <template-args> - ::= # empty - ::= <substitution> - - <template-prefix> ::= <prefix> - ::= <substitution> */ - -static status_t -demangle_prefix (dm, encode_return_type) - demangling_t dm; - int *encode_return_type; -{ - int start = substitution_start (dm); - int nested = 0; - - /* ENCODE_RETURN_TYPE is updated as we decend the nesting chain. - After <template-args>, it is set to non-zero; after everything - else it is set to zero. */ - - /* Generally, the return type is encoded if the function is a - template-id, and suppressed otherwise. There are a few cases, - though, in which the return type is not encoded even for a - templated function. In these cases, this flag is set. */ - int suppress_return_type = 0; - - DEMANGLE_TRACE ("prefix", dm); - - while (1) - { - char peek; - - if (end_of_name_p (dm)) - return "Unexpected end of name in <compound-name>."; - - peek = peek_char (dm); - - /* We'll initialize suppress_return_type to false, and set it to true - if we end up demangling a constructor name. However, make - sure we're not actually about to demangle template arguments - -- if so, this is the <template-args> following a - <template-prefix>, so we'll want the previous flag value - around. */ - if (peek != 'I') - suppress_return_type = 0; - - if (IS_DIGIT ((unsigned char) peek) - || (peek >= 'a' && peek <= 'z') - || peek == 'C' || peek == 'D' - || peek == 'S') - { - /* We have another level of scope qualification. */ - if (nested) - RETURN_IF_ERROR (result_add (dm, "::")); - else - nested = 1; - - if (peek == 'S') - /* The substitution determines whether this is a - template-id. */ - RETURN_IF_ERROR (demangle_substitution (dm, encode_return_type)); - else - { - /* It's just a name. */ - RETURN_IF_ERROR - (demangle_unqualified_name (dm, &suppress_return_type)); - *encode_return_type = 0; - } - } - else if (peek == 'Z') - RETURN_IF_ERROR (demangle_local_name (dm)); - else if (peek == 'I') - { - RETURN_IF_ERROR (demangle_template_args (dm)); - - /* Now we want to indicate to the caller that we've - demangled template arguments, thus the prefix was a - <template-prefix>. That's so that the caller knows to - demangle the function's return type, if this turns out to - be a function name. But, if it's a member template - constructor or a templated conversion operator, report it - as untemplated. Those never get encoded return types. */ - *encode_return_type = !suppress_return_type; - } - else if (peek == 'E') - /* All done. */ - return STATUS_OK; - else - return "Unexpected character in <compound-name>."; - - if (peek != 'S' - && peek_char (dm) != 'E') - /* Add a new substitution for the prefix thus far. */ - RETURN_IF_ERROR (substitution_add (dm, start, *encode_return_type)); - } -} - -/* Demangles and emits an <unqualified-name>. If this - <unqualified-name> is for a special function type that should never - have its return type encoded (particularly, a constructor or - conversion operator), *SUPPRESS_RETURN_TYPE is set to 1; otherwise, - it is set to zero. - - <unqualified-name> ::= <operator-name> - ::= <special-name> - ::= <source-name> */ - -static status_t -demangle_unqualified_name (dm, suppress_return_type) - demangling_t dm; - int *suppress_return_type; -{ - char peek = peek_char (dm); - - DEMANGLE_TRACE ("unqualified-name", dm); - - /* By default, don't force suppression of the return type (though - non-template functions still don't get a return type encoded). */ - *suppress_return_type = 0; - - if (IS_DIGIT ((unsigned char) peek)) - RETURN_IF_ERROR (demangle_source_name (dm)); - else if (peek >= 'a' && peek <= 'z') - { - int num_args; - - /* Conversion operators never have a return type encoded. */ - if (peek == 'c' && peek_char_next (dm) == 'v') - *suppress_return_type = 1; - - RETURN_IF_ERROR (demangle_operator_name (dm, 0, &num_args)); - } - else if (peek == 'C' || peek == 'D') - { - /* Constructors never have a return type encoded. */ - if (peek == 'C') - *suppress_return_type = 1; - - RETURN_IF_ERROR (demangle_ctor_dtor_name (dm)); - } - else - return "Unexpected character in <unqualified-name>."; - - return STATUS_OK; -} - -/* Demangles and emits <source-name>. - - <source-name> ::= <length number> <identifier> */ - -static status_t -demangle_source_name (dm) - demangling_t dm; -{ - int length; - - DEMANGLE_TRACE ("source-name", dm); - - /* Decode the length of the identifier. */ - RETURN_IF_ERROR (demangle_number (dm, &length, 10, 0)); - if (length == 0) - return "Zero length in <source-name>."; - - /* Now the identifier itself. It's placed into last_source_name, - where it can be used to build a constructor or destructor name. */ - RETURN_IF_ERROR (demangle_identifier (dm, length, - dm->last_source_name)); - - /* Emit it. */ - RETURN_IF_ERROR (result_add_string (dm, dm->last_source_name)); - - return STATUS_OK; -} - -/* Demangles a number, either a <number> or a <positive-number> at the - current position, consuming all consecutive digit characters. Sets - *VALUE to the resulting numberand returns STATUS_OK. The number is - interpreted as BASE, which must be either 10 or 36. If IS_SIGNED - is non-zero, negative numbers -- prefixed with `n' -- are accepted. - - <number> ::= [n] <positive-number> - - <positive-number> ::= <decimal integer> */ - -static status_t -demangle_number (dm, value, base, is_signed) - demangling_t dm; - int *value; - int base; - int is_signed; -{ - dyn_string_t number = dyn_string_new (10); - - DEMANGLE_TRACE ("number", dm); - - if (number == NULL) - return STATUS_ALLOCATION_FAILED; - - demangle_number_literally (dm, number, base, is_signed); - *value = strtol (dyn_string_buf (number), NULL, base); - dyn_string_delete (number); - - return STATUS_OK; -} - -/* Demangles a number at the current position. The digits (and minus - sign, if present) that make up the number are appended to STR. - Only base-BASE digits are accepted; BASE must be either 10 or 36. - If IS_SIGNED, negative numbers -- prefixed with `n' -- are - accepted. Does not consume a trailing underscore or other - terminating character. */ - -static status_t -demangle_number_literally (dm, str, base, is_signed) - demangling_t dm; - dyn_string_t str; - int base; - int is_signed; -{ - DEMANGLE_TRACE ("number*", dm); - - if (base != 10 && base != 36) - return STATUS_INTERNAL_ERROR; - - /* An `n' denotes a negative number. */ - if (is_signed && peek_char (dm) == 'n') - { - /* Skip past the n. */ - advance_char (dm); - /* The normal way to write a negative number is with a minus - sign. */ - if (!dyn_string_append_char (str, '-')) - return STATUS_ALLOCATION_FAILED; - } - - /* Loop until we hit a non-digit. */ - while (1) - { - char peek = peek_char (dm); - if (IS_DIGIT ((unsigned char) peek) - || (base == 36 && peek >= 'A' && peek <= 'Z')) - { - /* Accumulate digits. */ - if (!dyn_string_append_char (str, next_char (dm))) - return STATUS_ALLOCATION_FAILED; - } - else - /* Not a digit? All done. */ - break; - } - - return STATUS_OK; -} - -/* Demangles an identifier at the current position of LENGTH - characters and places it in IDENTIFIER. */ - -static status_t -demangle_identifier (dm, length, identifier) - demangling_t dm; - int length; - dyn_string_t identifier; -{ - DEMANGLE_TRACE ("identifier", dm); - - dyn_string_clear (identifier); - if (!dyn_string_resize (identifier, length)) - return STATUS_ALLOCATION_FAILED; - - while (length-- > 0) - { - if (end_of_name_p (dm)) - return "Unexpected end of name in <identifier>."; - if (!dyn_string_append_char (identifier, next_char (dm))) - return STATUS_ALLOCATION_FAILED; - } - - /* GCC encodes anonymous namespaces using a `_GLOBAL_[_.$]N.' - followed by the source file name and some random characters. - Unless we're in strict mode, decipher these names appropriately. */ - if (!flag_strict) - { - char *name = dyn_string_buf (identifier); - int prefix_length = strlen (ANONYMOUS_NAMESPACE_PREFIX); - - /* Compare the first, fixed part. */ - if (strncmp (name, ANONYMOUS_NAMESPACE_PREFIX, prefix_length) == 0) - { - name += prefix_length; - /* The next character might be a period, an underscore, or - dollar sign, depending on the target architecture's - assembler's capabilities. After that comes an `N'. */ - if ((*name == '.' || *name == '_' || *name == '$') - && *(name + 1) == 'N') - /* This looks like the anonymous namespace identifier. - Replace it with something comprehensible. */ - dyn_string_copy_cstr (identifier, "(anonymous namespace)"); - } - } - - return STATUS_OK; -} - -/* Demangles and emits an <operator-name>. If SHORT_NAME is non-zero, - the short form is emitted; otherwise the full source form - (`operator +' etc.) is emitted. *NUM_ARGS is set to the number of - operands that the operator takes. - - <operator-name> - ::= nw # new - ::= na # new[] - ::= dl # delete - ::= da # delete[] - ::= ps # + (unary) - ::= ng # - (unary) - ::= ad # & (unary) - ::= de # * (unary) - ::= co # ~ - ::= pl # + - ::= mi # - - ::= ml # * - ::= dv # / - ::= rm # % - ::= an # & - ::= or # | - ::= eo # ^ - ::= aS # = - ::= pL # += - ::= mI # -= - ::= mL # *= - ::= dV # /= - ::= rM # %= - ::= aN # &= - ::= oR # |= - ::= eO # ^= - ::= ls # << - ::= rs # >> - ::= lS # <<= - ::= rS # >>= - ::= eq # == - ::= ne # != - ::= lt # < - ::= gt # > - ::= le # <= - ::= ge # >= - ::= nt # ! - ::= aa # && - ::= oo # || - ::= pp # ++ - ::= mm # -- - ::= cm # , - ::= pm # ->* - ::= pt # -> - ::= cl # () - ::= ix # [] - ::= qu # ? - ::= sz # sizeof - ::= cv <type> # cast - ::= v [0-9] <source-name> # vendor extended operator */ - -static status_t -demangle_operator_name (dm, short_name, num_args) - demangling_t dm; - int short_name; - int *num_args; -{ - struct operator_code - { - /* The mangled code for this operator. */ - const char *code; - /* The source name of this operator. */ - const char *name; - /* The number of arguments this operator takes. */ - int num_args; - }; - - static const struct operator_code operators[] = - { - { "aN", "&=" , 2 }, - { "aS", "=" , 2 }, - { "aa", "&&" , 2 }, - { "ad", "&" , 1 }, - { "an", "&" , 2 }, - { "cl", "()" , 0 }, - { "cm", "," , 2 }, - { "co", "~" , 1 }, - { "dV", "/=" , 2 }, - { "da", " delete[]", 1 }, - { "de", "*" , 1 }, - { "dl", " delete" , 1 }, - { "dv", "/" , 2 }, - { "eO", "^=" , 2 }, - { "eo", "^" , 2 }, - { "eq", "==" , 2 }, - { "ge", ">=" , 2 }, - { "gt", ">" , 2 }, - { "ix", "[]" , 2 }, - { "lS", "<<=" , 2 }, - { "le", "<=" , 2 }, - { "ls", "<<" , 2 }, - { "lt", "<" , 2 }, - { "mI", "-=" , 2 }, - { "mL", "*=" , 2 }, - { "mi", "-" , 2 }, - { "ml", "*" , 2 }, - { "mm", "--" , 1 }, - { "na", " new[]" , 1 }, - { "ne", "!=" , 2 }, - { "ng", "-" , 1 }, - { "nt", "!" , 1 }, - { "nw", " new" , 1 }, - { "oR", "|=" , 2 }, - { "oo", "||" , 2 }, - { "or", "|" , 2 }, - { "pL", "+=" , 2 }, - { "pl", "+" , 2 }, - { "pm", "->*" , 2 }, - { "pp", "++" , 1 }, - { "ps", "+" , 1 }, - { "pt", "->" , 2 }, - { "qu", "?" , 3 }, - { "rM", "%=" , 2 }, - { "rS", ">>=" , 2 }, - { "rm", "%" , 2 }, - { "rs", ">>" , 2 }, - { "sz", " sizeof" , 1 } - }; - - const int num_operators = - sizeof (operators) / sizeof (struct operator_code); - - int c0 = next_char (dm); - int c1 = next_char (dm); - const struct operator_code* p1 = operators; - const struct operator_code* p2 = operators + num_operators; - - DEMANGLE_TRACE ("operator-name", dm); - - /* Is this a vendor-extended operator? */ - if (c0 == 'v' && IS_DIGIT (c1)) - { - RETURN_IF_ERROR (result_add (dm, "operator ")); - RETURN_IF_ERROR (demangle_source_name (dm)); - *num_args = 0; - return STATUS_OK; - } - - /* Is this a conversion operator? */ - if (c0 == 'c' && c1 == 'v') - { - RETURN_IF_ERROR (result_add (dm, "operator ")); - /* Demangle the converted-to type. */ - RETURN_IF_ERROR (demangle_type (dm)); - *num_args = 0; - return STATUS_OK; - } - - /* Perform a binary search for the operator code. */ - while (1) - { - const struct operator_code* p = p1 + (p2 - p1) / 2; - char match0 = p->code[0]; - char match1 = p->code[1]; - - if (c0 == match0 && c1 == match1) - /* Found it. */ - { - if (!short_name) - RETURN_IF_ERROR (result_add (dm, "operator")); - RETURN_IF_ERROR (result_add (dm, p->name)); - *num_args = p->num_args; - - return STATUS_OK; - } - - if (p == p1) - /* Couldn't find it. */ - return "Unknown code in <operator-name>."; - - /* Try again. */ - if (c0 < match0 || (c0 == match0 && c1 < match1)) - p2 = p; - else - p1 = p; - } -} - -/* Demangles and omits an <nv-offset>. - - <nv-offset> ::= <offset number> # non-virtual base override */ - -static status_t -demangle_nv_offset (dm) - demangling_t dm; -{ - dyn_string_t number; - status_t status = STATUS_OK; - - DEMANGLE_TRACE ("h-offset", dm); - - /* Demangle the offset. */ - number = dyn_string_new (4); - if (number == NULL) - return STATUS_ALLOCATION_FAILED; - demangle_number_literally (dm, number, 10, 1); - - /* Don't display the offset unless in verbose mode. */ - if (flag_verbose) - { - status = result_add (dm, " [nv:"); - if (STATUS_NO_ERROR (status)) - status = result_add_string (dm, number); - if (STATUS_NO_ERROR (status)) - status = result_add_char (dm, ']'); - } - - /* Clean up. */ - dyn_string_delete (number); - RETURN_IF_ERROR (status); - return STATUS_OK; -} - -/* Demangles and emits a <v-offset>. - - <v-offset> ::= <offset number> _ <virtual offset number> - # virtual base override, with vcall offset */ - -static status_t -demangle_v_offset (dm) - demangling_t dm; -{ - dyn_string_t number; - status_t status = STATUS_OK; - - DEMANGLE_TRACE ("v-offset", dm); - - /* Demangle the offset. */ - number = dyn_string_new (4); - if (number == NULL) - return STATUS_ALLOCATION_FAILED; - demangle_number_literally (dm, number, 10, 1); - - /* Don't display the offset unless in verbose mode. */ - if (flag_verbose) - { - status = result_add (dm, " [v:"); - if (STATUS_NO_ERROR (status)) - status = result_add_string (dm, number); - if (STATUS_NO_ERROR (status)) - result_add_char (dm, ','); - } - dyn_string_delete (number); - RETURN_IF_ERROR (status); - - /* Demangle the separator. */ - RETURN_IF_ERROR (demangle_char (dm, '_')); - - /* Demangle the vcall offset. */ - number = dyn_string_new (4); - if (number == NULL) - return STATUS_ALLOCATION_FAILED; - demangle_number_literally (dm, number, 10, 1); - - /* Don't display the vcall offset unless in verbose mode. */ - if (flag_verbose) - { - status = result_add_string (dm, number); - if (STATUS_NO_ERROR (status)) - status = result_add_char (dm, ']'); - } - dyn_string_delete (number); - RETURN_IF_ERROR (status); - - return STATUS_OK; -} - -/* Demangles and emits a <call-offset>. - - <call-offset> ::= h <nv-offset> _ - ::= v <v-offset> _ */ - -static status_t -demangle_call_offset (dm) - demangling_t dm; -{ - DEMANGLE_TRACE ("call-offset", dm); - - switch (peek_char (dm)) - { - case 'h': - advance_char (dm); - /* Demangle the offset. */ - RETURN_IF_ERROR (demangle_nv_offset (dm)); - /* Demangle the separator. */ - RETURN_IF_ERROR (demangle_char (dm, '_')); - break; - - case 'v': - advance_char (dm); - /* Demangle the offset. */ - RETURN_IF_ERROR (demangle_v_offset (dm)); - /* Demangle the separator. */ - RETURN_IF_ERROR (demangle_char (dm, '_')); - break; - - default: - return "Unrecognized <call-offset>."; - } - - return STATUS_OK; -} - -/* Demangles and emits a <special-name>. - - <special-name> ::= GV <object name> # Guard variable - ::= TV <type> # virtual table - ::= TT <type> # VTT - ::= TI <type> # typeinfo structure - ::= TS <type> # typeinfo name - - Other relevant productions include thunks: - - <special-name> ::= T <call-offset> <base encoding> - # base is the nominal target function of thunk - - <special-name> ::= Tc <call-offset> <call-offset> <base encoding> - # base is the nominal target function of thunk - # first call-offset is 'this' adjustment - # second call-offset is result adjustment - - where - - <call-offset> ::= h <nv-offset> _ - ::= v <v-offset> _ - - Also demangles the special g++ manglings, - - <special-name> ::= TC <type> <offset number> _ <base type> - # construction vtable - ::= TF <type> # typeinfo function (old ABI only) - ::= TJ <type> # java Class structure */ - -static status_t -demangle_special_name (dm) - demangling_t dm; -{ - dyn_string_t number; - int unused; - char peek = peek_char (dm); - - DEMANGLE_TRACE ("special-name", dm); - - if (peek == 'G') - { - /* A guard variable name. Consume the G. */ - advance_char (dm); - RETURN_IF_ERROR (demangle_char (dm, 'V')); - RETURN_IF_ERROR (result_add (dm, "guard variable for ")); - RETURN_IF_ERROR (demangle_name (dm, &unused)); - } - else if (peek == 'T') - { - status_t status = STATUS_OK; - - /* Other C++ implementation miscellania. Consume the T. */ - advance_char (dm); - - switch (peek_char (dm)) - { - case 'V': - /* Virtual table. */ - advance_char (dm); - RETURN_IF_ERROR (result_add (dm, "vtable for ")); - RETURN_IF_ERROR (demangle_type (dm)); - break; - - case 'T': - /* VTT structure. */ - advance_char (dm); - RETURN_IF_ERROR (result_add (dm, "VTT for ")); - RETURN_IF_ERROR (demangle_type (dm)); - break; - - case 'I': - /* Typeinfo structure. */ - advance_char (dm); - RETURN_IF_ERROR (result_add (dm, "typeinfo for ")); - RETURN_IF_ERROR (demangle_type (dm)); - break; - - case 'F': - /* Typeinfo function. Used only in old ABI with new mangling. */ - advance_char (dm); - RETURN_IF_ERROR (result_add (dm, "typeinfo fn for ")); - RETURN_IF_ERROR (demangle_type (dm)); - break; - - case 'S': - /* Character string containing type name, used in typeinfo. */ - advance_char (dm); - RETURN_IF_ERROR (result_add (dm, "typeinfo name for ")); - RETURN_IF_ERROR (demangle_type (dm)); - break; - - case 'J': - /* The java Class variable corresponding to a C++ class. */ - advance_char (dm); - RETURN_IF_ERROR (result_add (dm, "java Class for ")); - RETURN_IF_ERROR (demangle_type (dm)); - break; - - case 'h': - /* Non-virtual thunk. */ - advance_char (dm); - RETURN_IF_ERROR (result_add (dm, "non-virtual thunk")); - RETURN_IF_ERROR (demangle_nv_offset (dm)); - /* Demangle the separator. */ - RETURN_IF_ERROR (demangle_char (dm, '_')); - /* Demangle and emit the target name and function type. */ - RETURN_IF_ERROR (result_add (dm, " to ")); - RETURN_IF_ERROR (demangle_encoding (dm)); - break; - - case 'v': - /* Virtual thunk. */ - advance_char (dm); - RETURN_IF_ERROR (result_add (dm, "virtual thunk")); - RETURN_IF_ERROR (demangle_v_offset (dm)); - /* Demangle the separator. */ - RETURN_IF_ERROR (demangle_char (dm, '_')); - /* Demangle and emit the target function. */ - RETURN_IF_ERROR (result_add (dm, " to ")); - RETURN_IF_ERROR (demangle_encoding (dm)); - break; - - case 'c': - /* Covariant return thunk. */ - advance_char (dm); - RETURN_IF_ERROR (result_add (dm, "covariant return thunk")); - RETURN_IF_ERROR (demangle_call_offset (dm)); - RETURN_IF_ERROR (demangle_call_offset (dm)); - /* Demangle and emit the target function. */ - RETURN_IF_ERROR (result_add (dm, " to ")); - RETURN_IF_ERROR (demangle_encoding (dm)); - break; - - case 'C': - /* TC is a special g++ mangling for a construction vtable. */ - if (!flag_strict) - { - dyn_string_t derived_type; - - advance_char (dm); - RETURN_IF_ERROR (result_add (dm, "construction vtable for ")); - - /* Demangle the derived type off to the side. */ - RETURN_IF_ERROR (result_push (dm)); - RETURN_IF_ERROR (demangle_type (dm)); - derived_type = (dyn_string_t) result_pop (dm); - - /* Demangle the offset. */ - number = dyn_string_new (4); - if (number == NULL) - { - dyn_string_delete (derived_type); - return STATUS_ALLOCATION_FAILED; - } - demangle_number_literally (dm, number, 10, 1); - /* Demangle the underscore separator. */ - status = demangle_char (dm, '_'); - - /* Demangle the base type. */ - if (STATUS_NO_ERROR (status)) - status = demangle_type (dm); - - /* Emit the derived type. */ - if (STATUS_NO_ERROR (status)) - status = result_add (dm, "-in-"); - if (STATUS_NO_ERROR (status)) - status = result_add_string (dm, derived_type); - dyn_string_delete (derived_type); - - /* Don't display the offset unless in verbose mode. */ - if (flag_verbose) - { - status = result_add_char (dm, ' '); - if (STATUS_NO_ERROR (status)) - result_add_string (dm, number); - } - dyn_string_delete (number); - RETURN_IF_ERROR (status); - break; - } - /* If flag_strict, fall through. */ - - default: - return "Unrecognized <special-name>."; - } - } - else - return STATUS_ERROR; - - return STATUS_OK; -} - -/* Demangles and emits a <ctor-dtor-name>. - - <ctor-dtor-name> - ::= C1 # complete object (in-charge) ctor - ::= C2 # base object (not-in-charge) ctor - ::= C3 # complete object (in-charge) allocating ctor - ::= D0 # deleting (in-charge) dtor - ::= D1 # complete object (in-charge) dtor - ::= D2 # base object (not-in-charge) dtor */ - -static status_t -demangle_ctor_dtor_name (dm) - demangling_t dm; -{ - static const char *const ctor_flavors[] = - { - "in-charge", - "not-in-charge", - "allocating" - }; - static const char *const dtor_flavors[] = - { - "in-charge deleting", - "in-charge", - "not-in-charge" - }; - - int flavor; - char peek = peek_char (dm); - - DEMANGLE_TRACE ("ctor-dtor-name", dm); - - if (peek == 'C') - { - /* A constructor name. Consume the C. */ - advance_char (dm); - if (peek_char (dm) < '1' || peek_char (dm) > '3') - return "Unrecognized constructor."; - RETURN_IF_ERROR (result_add_string (dm, dm->last_source_name)); - /* Print the flavor of the constructor if in verbose mode. */ - flavor = next_char (dm) - '1'; - if (flag_verbose) - { - RETURN_IF_ERROR (result_add (dm, "[")); - RETURN_IF_ERROR (result_add (dm, ctor_flavors[flavor])); - RETURN_IF_ERROR (result_add_char (dm, ']')); - } - } - else if (peek == 'D') - { - /* A destructor name. Consume the D. */ - advance_char (dm); - if (peek_char (dm) < '0' || peek_char (dm) > '2') - return "Unrecognized destructor."; - RETURN_IF_ERROR (result_add_char (dm, '~')); - RETURN_IF_ERROR (result_add_string (dm, dm->last_source_name)); - /* Print the flavor of the destructor if in verbose mode. */ - flavor = next_char (dm) - '0'; - if (flag_verbose) - { - RETURN_IF_ERROR (result_add (dm, " [")); - RETURN_IF_ERROR (result_add (dm, dtor_flavors[flavor])); - RETURN_IF_ERROR (result_add_char (dm, ']')); - } - } - else - return STATUS_ERROR; - - return STATUS_OK; -} - -/* Handle pointer, reference, and pointer-to-member cases for - demangle_type. All consecutive `P's, `R's, and 'M's are joined to - build a pointer/reference type. We snarf all these, plus the - following <type>, all at once since we need to know whether we have - a pointer to data or pointer to function to construct the right - output syntax. C++'s pointer syntax is hairy. - - This function adds substitution candidates for every nested - pointer/reference type it processes, including the outermost, final - type, assuming the substitution starts at SUBSTITUTION_START in the - demangling result. For example, if this function demangles - `PP3Foo', it will add a substitution for `Foo', `Foo*', and - `Foo**', in that order. - - *INSERT_POS is a quantity used internally, when this function calls - itself recursively, to figure out where to insert pointer - punctuation on the way up. On entry to this function, INSERT_POS - should point to a temporary value, but that value need not be - initialized. - - <type> ::= P <type> - ::= R <type> - ::= <pointer-to-member-type> - - <pointer-to-member-type> ::= M </class/ type> </member/ type> */ - -static status_t -demangle_type_ptr (dm, insert_pos, substitution_start) - demangling_t dm; - int *insert_pos; - int substitution_start; -{ - status_t status; - int is_substitution_candidate = 1; - - DEMANGLE_TRACE ("type*", dm); - - /* Scan forward, collecting pointers and references into symbols, - until we hit something else. Then emit the type. */ - switch (peek_char (dm)) - { - case 'P': - /* A pointer. Snarf the `P'. */ - advance_char (dm); - /* Demangle the underlying type. */ - RETURN_IF_ERROR (demangle_type_ptr (dm, insert_pos, - substitution_start)); - /* Insert an asterisk where we're told to; it doesn't - necessarily go at the end. */ - RETURN_IF_ERROR (result_insert_char (dm, *insert_pos, '*')); - /* The next (outermost) pointer or reference character should go - after this one. */ - ++(*insert_pos); - break; - - case 'R': - /* A reference. Snarf the `R'. */ - advance_char (dm); - /* Demangle the underlying type. */ - RETURN_IF_ERROR (demangle_type_ptr (dm, insert_pos, - substitution_start)); - /* Insert an ampersand where we're told to; it doesn't - necessarily go at the end. */ - RETURN_IF_ERROR (result_insert_char (dm, *insert_pos, '&')); - /* The next (outermost) pointer or reference character should go - after this one. */ - ++(*insert_pos); - break; - - case 'M': - { - /* A pointer-to-member. */ - dyn_string_t class_type; - - /* Eat the 'M'. */ - advance_char (dm); - - /* Capture the type of which this is a pointer-to-member. */ - RETURN_IF_ERROR (result_push (dm)); - RETURN_IF_ERROR (demangle_type (dm)); - class_type = (dyn_string_t) result_pop (dm); - - if (peek_char (dm) == 'F') - /* A pointer-to-member function. We want output along the - lines of `void (C::*) (int, int)'. Demangle the function - type, which would in this case give `void () (int, int)' - and set *insert_pos to the spot between the first - parentheses. */ - status = demangle_type_ptr (dm, insert_pos, substitution_start); - else if (peek_char (dm) == 'A') - /* A pointer-to-member array variable. We want output that - looks like `int (Klass::*) [10]'. Demangle the array type - as `int () [10]', and set *insert_pos to the spot between - the parentheses. */ - status = demangle_array_type (dm, insert_pos); - else - { - /* A pointer-to-member variable. Demangle the type of the - pointed-to member. */ - status = demangle_type (dm); - /* Make it pretty. */ - if (STATUS_NO_ERROR (status) - && !result_previous_char_is_space (dm)) - status = result_add_char (dm, ' '); - /* The pointer-to-member notation (e.g. `C::*') follows the - member's type. */ - *insert_pos = result_caret_pos (dm); - } - - /* Build the pointer-to-member notation. */ - if (STATUS_NO_ERROR (status)) - status = result_insert (dm, *insert_pos, "::*"); - if (STATUS_NO_ERROR (status)) - status = result_insert_string (dm, *insert_pos, class_type); - /* There may be additional levels of (pointer or reference) - indirection in this type. If so, the `*' and `&' should be - added after the pointer-to-member notation (e.g. `C::*&' for - a reference to a pointer-to-member of class C). */ - *insert_pos += dyn_string_length (class_type) + 3; - - /* Clean up. */ - dyn_string_delete (class_type); - - RETURN_IF_ERROR (status); - } - break; - - case 'F': - /* Ooh, tricky, a pointer-to-function. When we demangle the - function type, the return type should go at the very - beginning. */ - *insert_pos = result_caret_pos (dm); - /* The parentheses indicate this is a function pointer or - reference type. */ - RETURN_IF_ERROR (result_add (dm, "()")); - /* Now demangle the function type. The return type will be - inserted before the `()', and the argument list will go after - it. */ - RETURN_IF_ERROR (demangle_function_type (dm, insert_pos)); - /* We should now have something along the lines of - `void () (int, int)'. The pointer or reference characters - have to inside the first set of parentheses. *insert_pos has - already been updated to point past the end of the return - type. Move it one character over so it points inside the - `()'. */ - ++(*insert_pos); - break; - - case 'A': - /* An array pointer or reference. demangle_array_type will figure - out where the asterisks and ampersands go. */ - RETURN_IF_ERROR (demangle_array_type (dm, insert_pos)); - break; - - default: - /* No more pointer or reference tokens; this is therefore a - pointer to data. Finish up by demangling the underlying - type. */ - RETURN_IF_ERROR (demangle_type (dm)); - /* The pointer or reference characters follow the underlying - type, as in `int*&'. */ - *insert_pos = result_caret_pos (dm); - /* Because of the production <type> ::= <substitution>, - demangle_type will already have added the underlying type as - a substitution candidate. Don't do it again. */ - is_substitution_candidate = 0; - break; - } - - if (is_substitution_candidate) - RETURN_IF_ERROR (substitution_add (dm, substitution_start, 0)); - - return STATUS_OK; -} - -/* Demangles and emits a <type>. - - <type> ::= <builtin-type> - ::= <function-type> - ::= <class-enum-type> - ::= <array-type> - ::= <pointer-to-member-type> - ::= <template-param> - ::= <template-template-param> <template-args> - ::= <CV-qualifiers> <type> - ::= P <type> # pointer-to - ::= R <type> # reference-to - ::= C <type> # complex pair (C 2000) - ::= G <type> # imaginary (C 2000) - ::= U <source-name> <type> # vendor extended type qualifier - ::= <substitution> */ - -static status_t -demangle_type (dm) - demangling_t dm; -{ - int start = substitution_start (dm); - char peek = peek_char (dm); - char peek_next; - int encode_return_type = 0; - template_arg_list_t old_arg_list = current_template_arg_list (dm); - int insert_pos; - - /* A <type> can be a <substitution>; therefore, this <type> is a - substitution candidate unless a special condition holds (see - below). */ - int is_substitution_candidate = 1; - - DEMANGLE_TRACE ("type", dm); - - /* A <class-enum-type> can start with a digit (a <source-name>), an - N (a <nested-name>), or a Z (a <local-name>). */ - if (IS_DIGIT ((unsigned char) peek) || peek == 'N' || peek == 'Z') - RETURN_IF_ERROR (demangle_class_enum_type (dm, &encode_return_type)); - /* Lower-case letters begin <builtin-type>s, except for `r', which - denotes restrict. */ - else if (peek >= 'a' && peek <= 'z' && peek != 'r') - { - RETURN_IF_ERROR (demangle_builtin_type (dm)); - /* Built-in types are not substitution candidates. */ - is_substitution_candidate = 0; - } - else - switch (peek) - { - case 'r': - case 'V': - case 'K': - /* CV-qualifiers (including restrict). We have to demangle - them off to the side, since C++ syntax puts them in a funny - place for qualified pointer and reference types. */ - { - status_t status; - dyn_string_t cv_qualifiers = dyn_string_new (24); - int old_caret_position = result_get_caret (dm); - - if (cv_qualifiers == NULL) - return STATUS_ALLOCATION_FAILED; - - /* Decode all adjacent CV qualifiers. */ - demangle_CV_qualifiers (dm, cv_qualifiers); - /* Emit them, and shift the caret left so that the - underlying type will be emitted before the qualifiers. */ - status = result_add_string (dm, cv_qualifiers); - result_shift_caret (dm, -dyn_string_length (cv_qualifiers)); - /* Clean up. */ - dyn_string_delete (cv_qualifiers); - RETURN_IF_ERROR (status); - /* Also prepend a blank, if needed. */ - RETURN_IF_ERROR (result_add_char (dm, ' ')); - result_shift_caret (dm, -1); - - /* Demangle the underlying type. It will be emitted before - the CV qualifiers, since we moved the caret. */ - RETURN_IF_ERROR (demangle_type (dm)); - - /* Put the caret back where it was previously. */ - result_set_caret (dm, old_caret_position); - } - break; - - case 'F': - return "Non-pointer or -reference function type."; - - case 'A': - RETURN_IF_ERROR (demangle_array_type (dm, NULL)); - break; - - case 'T': - /* It's either a <template-param> or a - <template-template-param>. In either case, demangle the - `T' token first. */ - RETURN_IF_ERROR (demangle_template_param (dm)); - - /* Check for a template argument list; if one is found, it's a - <template-template-param> ::= <template-param> - ::= <substitution> */ - if (peek_char (dm) == 'I') - { - /* Add a substitution candidate. The template parameter - `T' token is a substitution candidate by itself, - without the template argument list. */ - RETURN_IF_ERROR (substitution_add (dm, start, encode_return_type)); - - /* Now demangle the template argument list. */ - RETURN_IF_ERROR (demangle_template_args (dm)); - /* The entire type, including the template template - parameter and its argument list, will be added as a - substitution candidate below. */ - } - - break; - - case 'S': - /* First check if this is a special substitution. If it is, - this is a <class-enum-type>. Special substitutions have a - letter following the `S'; other substitutions have a digit - or underscore. */ - peek_next = peek_char_next (dm); - if (IS_DIGIT (peek_next) || peek_next == '_') - { - RETURN_IF_ERROR (demangle_substitution (dm, &encode_return_type)); - - /* The substituted name may have been a template name. - Check if template arguments follow, and if so, demangle - them. */ - if (peek_char (dm) == 'I') - RETURN_IF_ERROR (demangle_template_args (dm)); - else - /* A substitution token is not itself a substitution - candidate. (However, if the substituted template is - instantiated, the resulting type is.) */ - is_substitution_candidate = 0; - } - else - { - /* Now some trickiness. We have a special substitution - here. Often, the special substitution provides the - name of a template that's subsequently instantiated, - for instance `SaIcE' => std::allocator<char>. In these - cases we need to add a substitution candidate for the - entire <class-enum-type> and thus don't want to clear - the is_substitution_candidate flag. - - However, it's possible that what we have here is a - substitution token representing an entire type, such as - `Ss' => std::string. In this case, we mustn't add a - new substitution candidate for this substitution token. - To detect this case, remember where the start of the - substitution token is. */ - const char *next = dm->next; - /* Now demangle the <class-enum-type>. */ - RETURN_IF_ERROR - (demangle_class_enum_type (dm, &encode_return_type)); - /* If all that was just demangled is the two-character - special substitution token, supress the addition of a - new candidate for it. */ - if (dm->next == next + 2) - is_substitution_candidate = 0; - } - - break; - - case 'P': - case 'R': - case 'M': - RETURN_IF_ERROR (demangle_type_ptr (dm, &insert_pos, start)); - /* demangle_type_ptr adds all applicable substitution - candidates. */ - is_substitution_candidate = 0; - break; - - case 'C': - /* A C99 complex type. */ - RETURN_IF_ERROR (result_add (dm, "complex ")); - advance_char (dm); - RETURN_IF_ERROR (demangle_type (dm)); - break; - - case 'G': - /* A C99 imaginary type. */ - RETURN_IF_ERROR (result_add (dm, "imaginary ")); - advance_char (dm); - RETURN_IF_ERROR (demangle_type (dm)); - break; - - case 'U': - /* Vendor-extended type qualifier. */ - advance_char (dm); - RETURN_IF_ERROR (demangle_source_name (dm)); - RETURN_IF_ERROR (result_add_char (dm, ' ')); - RETURN_IF_ERROR (demangle_type (dm)); - break; - - default: - return "Unexpected character in <type>."; - } - - if (is_substitution_candidate) - /* Add a new substitution for the type. If this type was a - <template-param>, pass its index since from the point of - substitutions; a <template-param> token is a substitution - candidate distinct from the type that is substituted for it. */ - RETURN_IF_ERROR (substitution_add (dm, start, encode_return_type)); - - /* Pop off template argument lists added during mangling of this - type. */ - pop_to_template_arg_list (dm, old_arg_list); - - return STATUS_OK; -} - -/* C++ source names of builtin types, indexed by the mangled code - letter's position in the alphabet ('a' -> 0, 'b' -> 1, etc). */ -static const char *const builtin_type_names[26] = -{ - "signed char", /* a */ - "bool", /* b */ - "char", /* c */ - "double", /* d */ - "long double", /* e */ - "float", /* f */ - "__float128", /* g */ - "unsigned char", /* h */ - "int", /* i */ - "unsigned", /* j */ - NULL, /* k */ - "long", /* l */ - "unsigned long", /* m */ - "__int128", /* n */ - "unsigned __int128", /* o */ - NULL, /* p */ - NULL, /* q */ - NULL, /* r */ - "short", /* s */ - "unsigned short", /* t */ - NULL, /* u */ - "void", /* v */ - "wchar_t", /* w */ - "long long", /* x */ - "unsigned long long", /* y */ - "..." /* z */ -}; - -/* Demangles and emits a <builtin-type>. - - <builtin-type> ::= v # void - ::= w # wchar_t - ::= b # bool - ::= c # char - ::= a # signed char - ::= h # unsigned char - ::= s # short - ::= t # unsigned short - ::= i # int - ::= j # unsigned int - ::= l # long - ::= m # unsigned long - ::= x # long long, __int64 - ::= y # unsigned long long, __int64 - ::= n # __int128 - ::= o # unsigned __int128 - ::= f # float - ::= d # double - ::= e # long double, __float80 - ::= g # __float128 - ::= z # ellipsis - ::= u <source-name> # vendor extended type */ - -static status_t -demangle_builtin_type (dm) - demangling_t dm; -{ - - char code = peek_char (dm); - - DEMANGLE_TRACE ("builtin-type", dm); - - if (code == 'u') - { - advance_char (dm); - RETURN_IF_ERROR (demangle_source_name (dm)); - return STATUS_OK; - } - else if (code >= 'a' && code <= 'z') - { - const char *type_name = builtin_type_names[code - 'a']; - if (type_name == NULL) - return "Unrecognized <builtin-type> code."; - - RETURN_IF_ERROR (result_add (dm, type_name)); - advance_char (dm); - return STATUS_OK; - } - else - return "Non-alphabetic <builtin-type> code."; -} - -/* Demangles all consecutive CV-qualifiers (const, volatile, and - restrict) at the current position. The qualifiers are appended to - QUALIFIERS. Returns STATUS_OK. */ - -static status_t -demangle_CV_qualifiers (dm, qualifiers) - demangling_t dm; - dyn_string_t qualifiers; -{ - DEMANGLE_TRACE ("CV-qualifiers", dm); - - while (1) - { - switch (peek_char (dm)) - { - case 'r': - if (!dyn_string_append_space (qualifiers)) - return STATUS_ALLOCATION_FAILED; - if (!dyn_string_append_cstr (qualifiers, "restrict")) - return STATUS_ALLOCATION_FAILED; - break; - - case 'V': - if (!dyn_string_append_space (qualifiers)) - return STATUS_ALLOCATION_FAILED; - if (!dyn_string_append_cstr (qualifiers, "volatile")) - return STATUS_ALLOCATION_FAILED; - break; - - case 'K': - if (!dyn_string_append_space (qualifiers)) - return STATUS_ALLOCATION_FAILED; - if (!dyn_string_append_cstr (qualifiers, "const")) - return STATUS_ALLOCATION_FAILED; - break; - - default: - return STATUS_OK; - } - - advance_char (dm); - } -} - -/* Demangles and emits a <function-type>. *FUNCTION_NAME_POS is the - position in the result string of the start of the function - identifier, at which the function's return type will be inserted; - *FUNCTION_NAME_POS is updated to position past the end of the - function's return type. - - <function-type> ::= F [Y] <bare-function-type> E */ - -static status_t -demangle_function_type (dm, function_name_pos) - demangling_t dm; - int *function_name_pos; -{ - DEMANGLE_TRACE ("function-type", dm); - RETURN_IF_ERROR (demangle_char (dm, 'F')); - if (peek_char (dm) == 'Y') - { - /* Indicate this function has C linkage if in verbose mode. */ - if (flag_verbose) - RETURN_IF_ERROR (result_add (dm, " [extern \"C\"] ")); - advance_char (dm); - } - RETURN_IF_ERROR (demangle_bare_function_type (dm, function_name_pos)); - RETURN_IF_ERROR (demangle_char (dm, 'E')); - return STATUS_OK; -} - -/* Demangles and emits a <bare-function-type>. RETURN_TYPE_POS is the - position in the result string at which the function return type - should be inserted. If RETURN_TYPE_POS is BFT_NO_RETURN_TYPE, the - function's return type is assumed not to be encoded. - - <bare-function-type> ::= <signature type>+ */ - -static status_t -demangle_bare_function_type (dm, return_type_pos) - demangling_t dm; - int *return_type_pos; -{ - /* Sequence is the index of the current function parameter, counting - from zero. The value -1 denotes the return type. */ - int sequence = - (return_type_pos == BFT_NO_RETURN_TYPE ? 0 : -1); - - DEMANGLE_TRACE ("bare-function-type", dm); - - RETURN_IF_ERROR (result_add_char (dm, '(')); - while (!end_of_name_p (dm) && peek_char (dm) != 'E') - { - if (sequence == -1) - /* We're decoding the function's return type. */ - { - dyn_string_t return_type; - status_t status = STATUS_OK; - - /* Decode the return type off to the side. */ - RETURN_IF_ERROR (result_push (dm)); - RETURN_IF_ERROR (demangle_type (dm)); - return_type = (dyn_string_t) result_pop (dm); - - /* Add a space to the end of the type. Insert the return - type where we've been asked to. */ - if (!dyn_string_append_space (return_type)) - status = STATUS_ALLOCATION_FAILED; - if (STATUS_NO_ERROR (status)) - { - if (!dyn_string_insert (result_string (dm), *return_type_pos, - return_type)) - status = STATUS_ALLOCATION_FAILED; - else - *return_type_pos += dyn_string_length (return_type); - } - - dyn_string_delete (return_type); - RETURN_IF_ERROR (status); - } - else - { - /* Skip `void' parameter types. One should only occur as - the only type in a parameter list; in that case, we want - to print `foo ()' instead of `foo (void)'. */ - if (peek_char (dm) == 'v') - /* Consume the v. */ - advance_char (dm); - else - { - /* Separate parameter types by commas. */ - if (sequence > 0) - RETURN_IF_ERROR (result_add (dm, ", ")); - /* Demangle the type. */ - RETURN_IF_ERROR (demangle_type (dm)); - } - } - - ++sequence; - } - RETURN_IF_ERROR (result_add_char (dm, ')')); - - /* We should have demangled at least one parameter type (which would - be void, for a function that takes no parameters), plus the - return type, if we were supposed to demangle that. */ - if (sequence == -1) - return "Missing function return type."; - else if (sequence == 0) - return "Missing function parameter."; - - return STATUS_OK; -} - -/* Demangles and emits a <class-enum-type>. *ENCODE_RETURN_TYPE is set to - non-zero if the type is a template-id, zero otherwise. - - <class-enum-type> ::= <name> */ - -static status_t -demangle_class_enum_type (dm, encode_return_type) - demangling_t dm; - int *encode_return_type; -{ - DEMANGLE_TRACE ("class-enum-type", dm); - - RETURN_IF_ERROR (demangle_name (dm, encode_return_type)); - return STATUS_OK; -} - -/* Demangles and emits an <array-type>. - - If PTR_INSERT_POS is not NULL, the array type is formatted as a - pointer or reference to an array, except that asterisk and - ampersand punctuation is omitted (since it's not know at this - point). *PTR_INSERT_POS is set to the position in the demangled - name at which this punctuation should be inserted. For example, - `A10_i' is demangled to `int () [10]' and *PTR_INSERT_POS points - between the parentheses. - - If PTR_INSERT_POS is NULL, the array type is assumed not to be - pointer- or reference-qualified. Then, for example, `A10_i' is - demangled simply as `int[10]'. - - <array-type> ::= A [<dimension number>] _ <element type> - ::= A <dimension expression> _ <element type> */ - -static status_t -demangle_array_type (dm, ptr_insert_pos) - demangling_t dm; - int *ptr_insert_pos; -{ - status_t status = STATUS_OK; - dyn_string_t array_size = NULL; - char peek; - - DEMANGLE_TRACE ("array-type", dm); - - RETURN_IF_ERROR (demangle_char (dm, 'A')); - - /* Demangle the array size into array_size. */ - peek = peek_char (dm); - if (peek == '_') - /* Array bound is omitted. This is a C99-style VLA. */ - ; - else if (IS_DIGIT (peek_char (dm))) - { - /* It looks like a constant array bound. */ - array_size = dyn_string_new (10); - if (array_size == NULL) - return STATUS_ALLOCATION_FAILED; - status = demangle_number_literally (dm, array_size, 10, 0); - } - else - { - /* Anything is must be an expression for a nont-constant array - bound. This happens if the array type occurs in a template - and the array bound references a template parameter. */ - RETURN_IF_ERROR (result_push (dm)); - RETURN_IF_ERROR (demangle_expression (dm)); - array_size = (dyn_string_t) result_pop (dm); - } - /* array_size may have been allocated by now, so we can't use - RETURN_IF_ERROR until it's been deallocated. */ - - /* Demangle the base type of the array. */ - if (STATUS_NO_ERROR (status)) - status = demangle_char (dm, '_'); - if (STATUS_NO_ERROR (status)) - status = demangle_type (dm); - - if (ptr_insert_pos != NULL) - { - /* This array is actually part of an pointer- or - reference-to-array type. Format appropriately, except we - don't know which and how much punctuation to use. */ - if (STATUS_NO_ERROR (status)) - status = result_add (dm, " () "); - /* Let the caller know where to insert the punctuation. */ - *ptr_insert_pos = result_caret_pos (dm) - 2; - } - - /* Emit the array dimension syntax. */ - if (STATUS_NO_ERROR (status)) - status = result_add_char (dm, '['); - if (STATUS_NO_ERROR (status) && array_size != NULL) - status = result_add_string (dm, array_size); - if (STATUS_NO_ERROR (status)) - status = result_add_char (dm, ']'); - if (array_size != NULL) - dyn_string_delete (array_size); - - RETURN_IF_ERROR (status); - - return STATUS_OK; -} - -/* Demangles and emits a <template-param>. - - <template-param> ::= T_ # first template parameter - ::= T <parameter-2 number> _ */ - -static status_t -demangle_template_param (dm) - demangling_t dm; -{ - int parm_number; - template_arg_list_t current_arg_list = current_template_arg_list (dm); - string_list_t arg; - - DEMANGLE_TRACE ("template-param", dm); - - /* Make sure there is a template argmust list in which to look up - this parameter reference. */ - if (current_arg_list == NULL) - return "Template parameter outside of template."; - - RETURN_IF_ERROR (demangle_char (dm, 'T')); - if (peek_char (dm) == '_') - parm_number = 0; - else - { - RETURN_IF_ERROR (demangle_number (dm, &parm_number, 10, 0)); - ++parm_number; - } - RETURN_IF_ERROR (demangle_char (dm, '_')); - - arg = template_arg_list_get_arg (current_arg_list, parm_number); - if (arg == NULL) - /* parm_number exceeded the number of arguments in the current - template argument list. */ - return "Template parameter number out of bounds."; - RETURN_IF_ERROR (result_add_string (dm, (dyn_string_t) arg)); - - return STATUS_OK; -} - -/* Demangles and emits a <template-args>. - - <template-args> ::= I <template-arg>+ E */ - -static status_t -demangle_template_args (dm) - demangling_t dm; -{ - int first = 1; - dyn_string_t old_last_source_name; - template_arg_list_t arg_list = template_arg_list_new (); - - if (arg_list == NULL) - return STATUS_ALLOCATION_FAILED; - - /* Preserve the most recently demangled source name. */ - old_last_source_name = dm->last_source_name; - dm->last_source_name = dyn_string_new (0); - - DEMANGLE_TRACE ("template-args", dm); - - if (dm->last_source_name == NULL) - return STATUS_ALLOCATION_FAILED; - - RETURN_IF_ERROR (demangle_char (dm, 'I')); - RETURN_IF_ERROR (result_open_template_list (dm)); - do - { - string_list_t arg; - - if (first) - first = 0; - else - RETURN_IF_ERROR (result_add (dm, ", ")); - - /* Capture the template arg. */ - RETURN_IF_ERROR (result_push (dm)); - RETURN_IF_ERROR (demangle_template_arg (dm)); - arg = result_pop (dm); - - /* Emit it in the demangled name. */ - RETURN_IF_ERROR (result_add_string (dm, (dyn_string_t) arg)); - - /* Save it for use in expanding <template-param>s. */ - template_arg_list_add_arg (arg_list, arg); - } - while (peek_char (dm) != 'E'); - /* Append the '>'. */ - RETURN_IF_ERROR (result_close_template_list (dm)); - - /* Consume the 'E'. */ - advance_char (dm); - - /* Restore the most recent demangled source name. */ - dyn_string_delete (dm->last_source_name); - dm->last_source_name = old_last_source_name; - - /* Push the list onto the top of the stack of template argument - lists, so that arguments from it are used from now on when - expanding <template-param>s. */ - push_template_arg_list (dm, arg_list); - - return STATUS_OK; -} - -/* This function, which does not correspond to a production in the - mangling spec, handles the `literal' production for both - <template-arg> and <expr-primary>. It does not expect or consume - the initial `L' or final `E'. The demangling is given by: - - <literal> ::= <type> </value/ number> - - and the emitted output is `(type)number'. */ - -static status_t -demangle_literal (dm) - demangling_t dm; -{ - char peek = peek_char (dm); - dyn_string_t value_string; - status_t status; - - DEMANGLE_TRACE ("literal", dm); - - if (!flag_verbose && peek >= 'a' && peek <= 'z') - { - /* If not in verbose mode and this is a builtin type, see if we - can produce simpler numerical output. In particular, for - integer types shorter than `long', just write the number - without type information; for bools, write `true' or `false'. - Other refinements could be made here too. */ - - /* This constant string is used to map from <builtin-type> codes - (26 letters of the alphabet) to codes that determine how the - value will be displayed. The codes are: - b: display as bool - i: display as int - l: display as long - A space means the value will be represented using cast - notation. */ - static const char *const code_map = "ibi iii ll ii i "; - - char code = code_map[peek - 'a']; - /* FIXME: Implement demangling of floats and doubles. */ - if (code == 'u') - return STATUS_UNIMPLEMENTED; - if (code == 'b') - { - /* It's a boolean. */ - char value; - - /* Consume the b. */ - advance_char (dm); - /* Look at the next character. It should be 0 or 1, - corresponding to false or true, respectively. */ - value = peek_char (dm); - if (value == '0') - RETURN_IF_ERROR (result_add (dm, "false")); - else if (value == '1') - RETURN_IF_ERROR (result_add (dm, "true")); - else - return "Unrecognized bool constant."; - /* Consume the 0 or 1. */ - advance_char (dm); - return STATUS_OK; - } - else if (code == 'i' || code == 'l') - { - /* It's an integer or long. */ - - /* Consume the type character. */ - advance_char (dm); - - /* Demangle the number and write it out. */ - value_string = dyn_string_new (0); - status = demangle_number_literally (dm, value_string, 10, 1); - if (STATUS_NO_ERROR (status)) - status = result_add_string (dm, value_string); - /* For long integers, append an l. */ - if (code == 'l' && STATUS_NO_ERROR (status)) - status = result_add_char (dm, code); - dyn_string_delete (value_string); - - RETURN_IF_ERROR (status); - return STATUS_OK; - } - /* ...else code == ' ', so fall through to represent this - literal's type explicitly using cast syntax. */ - } - - RETURN_IF_ERROR (result_add_char (dm, '(')); - RETURN_IF_ERROR (demangle_type (dm)); - RETURN_IF_ERROR (result_add_char (dm, ')')); - - value_string = dyn_string_new (0); - if (value_string == NULL) - return STATUS_ALLOCATION_FAILED; - - status = demangle_number_literally (dm, value_string, 10, 1); - if (STATUS_NO_ERROR (status)) - status = result_add_string (dm, value_string); - dyn_string_delete (value_string); - RETURN_IF_ERROR (status); - - return STATUS_OK; -} - -/* Demangles and emits a <template-arg>. - - <template-arg> ::= <type> # type - ::= L <type> <value number> E # literal - ::= LZ <encoding> E # external name - ::= X <expression> E # expression */ - -static status_t -demangle_template_arg (dm) - demangling_t dm; -{ - DEMANGLE_TRACE ("template-arg", dm); - - switch (peek_char (dm)) - { - case 'L': - advance_char (dm); - - if (peek_char (dm) == 'Z') - { - /* External name. */ - advance_char (dm); - /* FIXME: Standard is contradictory here. */ - RETURN_IF_ERROR (demangle_encoding (dm)); - } - else - RETURN_IF_ERROR (demangle_literal (dm)); - RETURN_IF_ERROR (demangle_char (dm, 'E')); - break; - - case 'X': - /* Expression. */ - advance_char (dm); - RETURN_IF_ERROR (demangle_expression (dm)); - RETURN_IF_ERROR (demangle_char (dm, 'E')); - break; - - default: - RETURN_IF_ERROR (demangle_type (dm)); - break; - } - - return STATUS_OK; -} - -/* Demangles and emits an <expression>. - - <expression> ::= <unary operator-name> <expression> - ::= <binary operator-name> <expression> <expression> - ::= <expr-primary> - ::= <scope-expression> */ - -static status_t -demangle_expression (dm) - demangling_t dm; -{ - char peek = peek_char (dm); - - DEMANGLE_TRACE ("expression", dm); - - if (peek == 'L' || peek == 'T') - RETURN_IF_ERROR (demangle_expr_primary (dm)); - else if (peek == 's' && peek_char_next (dm) == 'r') - RETURN_IF_ERROR (demangle_scope_expression (dm)); - else - /* An operator expression. */ - { - int num_args; - status_t status = STATUS_OK; - dyn_string_t operator_name; - - /* We have an operator name. Since we want to output binary - operations in infix notation, capture the operator name - first. */ - RETURN_IF_ERROR (result_push (dm)); - RETURN_IF_ERROR (demangle_operator_name (dm, 1, &num_args)); - operator_name = (dyn_string_t) result_pop (dm); - - /* If it's binary, do an operand first. */ - if (num_args > 1) - { - status = result_add_char (dm, '('); - if (STATUS_NO_ERROR (status)) - status = demangle_expression (dm); - if (STATUS_NO_ERROR (status)) - status = result_add_char (dm, ')'); - } - - /* Emit the operator. */ - if (STATUS_NO_ERROR (status)) - status = result_add_string (dm, operator_name); - dyn_string_delete (operator_name); - RETURN_IF_ERROR (status); - - /* Emit its second (if binary) or only (if unary) operand. */ - RETURN_IF_ERROR (result_add_char (dm, '(')); - RETURN_IF_ERROR (demangle_expression (dm)); - RETURN_IF_ERROR (result_add_char (dm, ')')); - - /* The ternary operator takes a third operand. */ - if (num_args == 3) - { - RETURN_IF_ERROR (result_add (dm, ":(")); - RETURN_IF_ERROR (demangle_expression (dm)); - RETURN_IF_ERROR (result_add_char (dm, ')')); - } - } - - return STATUS_OK; -} - -/* Demangles and emits a <scope-expression>. - - <scope-expression> ::= sr <qualifying type> <source-name> - ::= sr <qualifying type> <encoding> */ - -static status_t -demangle_scope_expression (dm) - demangling_t dm; -{ - RETURN_IF_ERROR (demangle_char (dm, 's')); - RETURN_IF_ERROR (demangle_char (dm, 'r')); - RETURN_IF_ERROR (demangle_type (dm)); - RETURN_IF_ERROR (result_add (dm, "::")); - RETURN_IF_ERROR (demangle_encoding (dm)); - return STATUS_OK; -} - -/* Demangles and emits an <expr-primary>. - - <expr-primary> ::= <template-param> - ::= L <type> <value number> E # literal - ::= L <mangled-name> E # external name */ - -static status_t -demangle_expr_primary (dm) - demangling_t dm; -{ - char peek = peek_char (dm); - - DEMANGLE_TRACE ("expr-primary", dm); - - if (peek == 'T') - RETURN_IF_ERROR (demangle_template_param (dm)); - else if (peek == 'L') - { - /* Consume the `L'. */ - advance_char (dm); - peek = peek_char (dm); - - if (peek == '_') - RETURN_IF_ERROR (demangle_mangled_name (dm)); - else - RETURN_IF_ERROR (demangle_literal (dm)); - - RETURN_IF_ERROR (demangle_char (dm, 'E')); - } - else - return STATUS_ERROR; - - return STATUS_OK; -} - -/* Demangles and emits a <substitution>. Sets *TEMPLATE_P to non-zero - if the substitution is the name of a template, zero otherwise. - - <substitution> ::= S <seq-id> _ - ::= S_ - - ::= St # ::std:: - ::= Sa # ::std::allocator - ::= Sb # ::std::basic_string - ::= Ss # ::std::basic_string<char, - ::std::char_traits<char>, - ::std::allocator<char> > - ::= Si # ::std::basic_istream<char, - std::char_traits<char> > - ::= So # ::std::basic_ostream<char, - std::char_traits<char> > - ::= Sd # ::std::basic_iostream<char, - std::char_traits<char> > -*/ - -static status_t -demangle_substitution (dm, template_p) - demangling_t dm; - int *template_p; -{ - int seq_id; - int peek; - dyn_string_t text; - - DEMANGLE_TRACE ("substitution", dm); - - RETURN_IF_ERROR (demangle_char (dm, 'S')); - - /* Scan the substitution sequence index. A missing number denotes - the first index. */ - peek = peek_char (dm); - if (peek == '_') - seq_id = -1; - /* If the following character is 0-9 or a capital letter, interpret - the sequence up to the next underscore as a base-36 substitution - index. */ - else if (IS_DIGIT ((unsigned char) peek) - || (peek >= 'A' && peek <= 'Z')) - RETURN_IF_ERROR (demangle_number (dm, &seq_id, 36, 0)); - else - { - const char *new_last_source_name = NULL; - - switch (peek) - { - case 't': - RETURN_IF_ERROR (result_add (dm, "std")); - break; - - case 'a': - RETURN_IF_ERROR (result_add (dm, "std::allocator")); - new_last_source_name = "allocator"; - *template_p = 1; - break; - - case 'b': - RETURN_IF_ERROR (result_add (dm, "std::basic_string")); - new_last_source_name = "basic_string"; - *template_p = 1; - break; - - case 's': - if (!flag_verbose) - { - RETURN_IF_ERROR (result_add (dm, "std::string")); - new_last_source_name = "string"; - } - else - { - RETURN_IF_ERROR (result_add (dm, "std::basic_string<char, std::char_traits<char>, std::allocator<char> >")); - new_last_source_name = "basic_string"; - } - *template_p = 0; - break; - - case 'i': - if (!flag_verbose) - { - RETURN_IF_ERROR (result_add (dm, "std::istream")); - new_last_source_name = "istream"; - } - else - { - RETURN_IF_ERROR (result_add (dm, "std::basic_istream<char, std::char_traints<char> >")); - new_last_source_name = "basic_istream"; - } - *template_p = 0; - break; - - case 'o': - if (!flag_verbose) - { - RETURN_IF_ERROR (result_add (dm, "std::ostream")); - new_last_source_name = "ostream"; - } - else - { - RETURN_IF_ERROR (result_add (dm, "std::basic_ostream<char, std::char_traits<char> >")); - new_last_source_name = "basic_ostream"; - } - *template_p = 0; - break; - - case 'd': - if (!flag_verbose) - { - RETURN_IF_ERROR (result_add (dm, "std::iostream")); - new_last_source_name = "iostream"; - } - else - { - RETURN_IF_ERROR (result_add (dm, "std::basic_iostream<char, std::char_traits<char> >")); - new_last_source_name = "basic_iostream"; - } - *template_p = 0; - break; - - default: - return "Unrecognized <substitution>."; - } - - /* Consume the character we just processed. */ - advance_char (dm); - - if (new_last_source_name != NULL) - { - if (!dyn_string_copy_cstr (dm->last_source_name, - new_last_source_name)) - return STATUS_ALLOCATION_FAILED; - } - - return STATUS_OK; - } - - /* Look up the substitution text. Since `S_' is the most recent - substitution, `S0_' is the second-most-recent, etc., shift the - numbering by one. */ - text = substitution_get (dm, seq_id + 1, template_p); - if (text == NULL) - return "Substitution number out of range."; - - /* Emit the substitution text. */ - RETURN_IF_ERROR (result_add_string (dm, text)); - - RETURN_IF_ERROR (demangle_char (dm, '_')); - return STATUS_OK; -} - -/* Demangles and emits a <local-name>. - - <local-name> := Z <function encoding> E <entity name> [<discriminator>] - := Z <function encoding> E s [<discriminator>] */ - -static status_t -demangle_local_name (dm) - demangling_t dm; -{ - DEMANGLE_TRACE ("local-name", dm); - - RETURN_IF_ERROR (demangle_char (dm, 'Z')); - RETURN_IF_ERROR (demangle_encoding (dm)); - RETURN_IF_ERROR (demangle_char (dm, 'E')); - RETURN_IF_ERROR (result_add (dm, "::")); - - if (peek_char (dm) == 's') - { - /* Local character string literal. */ - RETURN_IF_ERROR (result_add (dm, "string literal")); - /* Consume the s. */ - advance_char (dm); - RETURN_IF_ERROR (demangle_discriminator (dm, 0)); - } - else - { - int unused; - /* Local name for some other entity. Demangle its name. */ - RETURN_IF_ERROR (demangle_name (dm, &unused)); - RETURN_IF_ERROR (demangle_discriminator (dm, 1)); - } - - return STATUS_OK; - } - - /* Optimonally demangles and emits a <discriminator>. If there is no - <discriminator> at the current position in the mangled string, the - descriminator is assumed to be zero. Emit the discriminator number - in parentheses, unless SUPPRESS_FIRST is non-zero and the - discriminator is zero. - - <discriminator> ::= _ <number> */ - -static status_t -demangle_discriminator (dm, suppress_first) - demangling_t dm; - int suppress_first; -{ - /* Output for <discriminator>s to the demangled name is completely - suppressed if not in verbose mode. */ - - if (peek_char (dm) == '_') - { - /* Consume the underscore. */ - advance_char (dm); - if (flag_verbose) - RETURN_IF_ERROR (result_add (dm, " [#")); - /* Check if there's a number following the underscore. */ - if (IS_DIGIT ((unsigned char) peek_char (dm))) - { - int discriminator; - /* Demangle the number. */ - RETURN_IF_ERROR (demangle_number (dm, &discriminator, 10, 0)); - if (flag_verbose) - /* Write the discriminator. The mangled number is two - less than the discriminator ordinal, counting from - zero. */ - RETURN_IF_ERROR (int_to_dyn_string (discriminator + 2, - (dyn_string_t) dm->result)); - } - else - { - if (flag_verbose) - /* A missing digit correspond to one. */ - RETURN_IF_ERROR (result_add_char (dm, '1')); - } - if (flag_verbose) - RETURN_IF_ERROR (result_add_char (dm, ']')); - } - else if (!suppress_first) - { - if (flag_verbose) - RETURN_IF_ERROR (result_add (dm, " [#0]")); - } - - return STATUS_OK; -} - -/* Demangle NAME into RESULT, which must be an initialized - dyn_string_t. On success, returns STATUS_OK. On failure, returns - an error message, and the contents of RESULT are unchanged. */ - -static status_t -cp_demangle (name, result) - const char *name; - dyn_string_t result; -{ - status_t status; - int length = strlen (name); - - if (length > 2 && name[0] == '_' && name[1] == 'Z') - { - demangling_t dm = demangling_new (name); - if (dm == NULL) - return STATUS_ALLOCATION_FAILED; - - status = result_push (dm); - if (status != STATUS_OK) - { - demangling_delete (dm); - return status; - } - - status = demangle_mangled_name (dm); - if (STATUS_NO_ERROR (status)) - { - dyn_string_t demangled = (dyn_string_t) result_pop (dm); - if (!dyn_string_copy (result, demangled)) - return STATUS_ALLOCATION_FAILED; - dyn_string_delete (demangled); - } - - demangling_delete (dm); - } - else - { - /* It's evidently not a mangled C++ name. It could be the name - of something with C linkage, though, so just copy NAME into - RESULT. */ - if (!dyn_string_copy_cstr (result, name)) - return STATUS_ALLOCATION_FAILED; - status = STATUS_OK; - } - - return status; -} - -/* Demangle TYPE_NAME into RESULT, which must be an initialized - dyn_string_t. On success, returns STATUS_OK. On failiure, returns - an error message, and the contents of RESULT are unchanged. */ - -#ifdef IN_LIBGCC2 -static status_t -cp_demangle_type (type_name, result) - const char* type_name; - dyn_string_t result; -{ - status_t status; - demangling_t dm = demangling_new (type_name); - - if (dm == NULL) - return STATUS_ALLOCATION_FAILED; - - /* Demangle the type name. The demangled name is stored in dm. */ - status = result_push (dm); - if (status != STATUS_OK) - { - demangling_delete (dm); - return status; - } - - status = demangle_type (dm); - - if (STATUS_NO_ERROR (status)) - { - /* The demangling succeeded. Pop the result out of dm and copy - it into RESULT. */ - dyn_string_t demangled = (dyn_string_t) result_pop (dm); - if (!dyn_string_copy (result, demangled)) - return STATUS_ALLOCATION_FAILED; - dyn_string_delete (demangled); - } - - /* Clean up. */ - demangling_delete (dm); - - return status; -} - -extern char *__cxa_demangle PARAMS ((const char *, char *, size_t *, int *)); - -/* ia64 ABI-mandated entry point in the C++ runtime library for performing - demangling. MANGLED_NAME is a NUL-terminated character string - containing the name to be demangled. - - OUTPUT_BUFFER is a region of memory, allocated with malloc, of - *LENGTH bytes, into which the demangled name is stored. If - OUTPUT_BUFFER is not long enough, it is expanded using realloc. - OUTPUT_BUFFER may instead be NULL; in that case, the demangled name - is placed in a region of memory allocated with malloc. - - If LENGTH is non-NULL, the length of the buffer conaining the - demangled name, is placed in *LENGTH. - - The return value is a pointer to the start of the NUL-terminated - demangled name, or NULL if the demangling fails. The caller is - responsible for deallocating this memory using free. - - *STATUS is set to one of the following values: - 0: The demangling operation succeeded. - -1: A memory allocation failiure occurred. - -2: MANGLED_NAME is not a valid name under the C++ ABI mangling rules. - -3: One of the arguments is invalid. - - The demagling is performed using the C++ ABI mangling rules, with - GNU extensions. */ - -char * -__cxa_demangle (mangled_name, output_buffer, length, status) - const char *mangled_name; - char *output_buffer; - size_t *length; - int *status; -{ - struct dyn_string demangled_name; - status_t result; - - if (status == NULL) - return NULL; - - if (mangled_name == NULL) { - *status = -3; - return NULL; - } - - /* Did the caller provide a buffer for the demangled name? */ - if (output_buffer == NULL) { - /* No; dyn_string will malloc a buffer for us. */ - if (!dyn_string_init (&demangled_name, 0)) - { - *status = -1; - return NULL; - } - } - else { - /* Yes. Check that the length was provided. */ - if (length == NULL) { - *status = -3; - return NULL; - } - /* Install the buffer into a dyn_string. */ - demangled_name.allocated = *length; - demangled_name.length = 0; - demangled_name.s = output_buffer; - } - - if (mangled_name[0] == '_' && mangled_name[1] == 'Z') - /* MANGLED_NAME apprears to be a function or variable name. - Demangle it accordingly. */ - result = cp_demangle (mangled_name, &demangled_name); - else - /* Try to demangled MANGLED_NAME as the name of a type. */ - result = cp_demangle_type (mangled_name, &demangled_name); - - if (result == STATUS_OK) - /* The demangling succeeded. */ - { - /* If LENGTH isn't NULL, store the allocated buffer length - there; the buffer may have been realloced by dyn_string - functions. */ - if (length != NULL) - *length = demangled_name.allocated; - /* The operation was a success. */ - *status = 0; - return dyn_string_buf (&demangled_name); - } - else if (result == STATUS_ALLOCATION_FAILED) - /* A call to malloc or realloc failed during the demangling - operation. */ - { - *status = -1; - return NULL; - } - else - /* The demangling failed for another reason, most probably because - MANGLED_NAME isn't a valid mangled name. */ - { - /* If the buffer containing the demangled name wasn't provided - by the caller, free it. */ - if (output_buffer == NULL) - free (dyn_string_buf (&demangled_name)); - *status = -2; - return NULL; - } -} - -#else /* !IN_LIBGCC2 */ - -/* Variant entry point for integration with the existing cplus-dem - demangler. Attempts to demangle MANGLED. If the demangling - succeeds, returns a buffer, allocated with malloc, containing the - demangled name. The caller must deallocate the buffer using free. - If the demangling failes, returns NULL. */ - -char * -cplus_demangle_v3 (mangled) - const char* mangled; -{ - dyn_string_t demangled; - status_t status; - - /* If this isn't a mangled name, don't pretend to demangle it. */ - if (strncmp (mangled, "_Z", 2) != 0) - return NULL; - - /* Create a dyn_string to hold the demangled name. */ - demangled = dyn_string_new (0); - /* Attempt the demangling. */ - status = cp_demangle ((char *) mangled, demangled); - - if (STATUS_NO_ERROR (status)) - /* Demangling succeeded. */ - { - /* Grab the demangled result from the dyn_string. It was - allocated with malloc, so we can return it directly. */ - char *return_value = dyn_string_release (demangled); - /* Hand back the demangled name. */ - return return_value; - } - else if (status == STATUS_ALLOCATION_FAILED) - { - fprintf (stderr, "Memory allocation failed.\n"); - abort (); - } - else - /* Demangling failed. */ - { - dyn_string_delete (demangled); - return NULL; - } -} - -#endif /* IN_LIBGCC2 */ - -#ifdef STANDALONE_DEMANGLER - -#include "getopt.h" - -static void print_usage - PARAMS ((FILE* fp, int exit_value)); - -/* Non-zero if CHAR is a character than can occur in a mangled name. */ -#define is_mangled_char(CHAR) \ - (IS_ALPHA (CHAR) || IS_DIGIT (CHAR) \ - || (CHAR) == '_' || (CHAR) == '.' || (CHAR) == '$') - -/* The name of this program, as invoked. */ -const char* program_name; - -/* Prints usage summary to FP and then exits with EXIT_VALUE. */ - -static void -print_usage (fp, exit_value) - FILE* fp; - int exit_value; -{ - fprintf (fp, "Usage: %s [options] [names ...]\n", program_name); - fprintf (fp, "Options:\n"); - fprintf (fp, " -h,--help Display this message.\n"); - fprintf (fp, " -s,--strict Demangle standard names only.\n"); - fprintf (fp, " -v,--verbose Produce verbose demanglings.\n"); - fprintf (fp, "If names are provided, they are demangled. Otherwise filters standard input.\n"); - - exit (exit_value); -} - -/* Option specification for getopt_long. */ -static struct option long_options[] = -{ - { "help", no_argument, NULL, 'h' }, - { "strict", no_argument, NULL, 's' }, - { "verbose", no_argument, NULL, 'v' }, - { NULL, no_argument, NULL, 0 }, -}; - -/* Main entry for a demangling filter executable. It will demangle - its command line arguments, if any. If none are provided, it will - filter stdin to stdout, replacing any recognized mangled C++ names - with their demangled equivalents. */ - -int -main (argc, argv) - int argc; - char *argv[]; -{ - status_t status; - int i; - int opt_char; - - /* Use the program name of this program, as invoked. */ - program_name = argv[0]; - - /* Parse options. */ - do - { - opt_char = getopt_long (argc, argv, "hsv", long_options, NULL); - switch (opt_char) - { - case '?': /* Unrecognized option. */ - print_usage (stderr, 1); - break; - - case 'h': - print_usage (stdout, 0); - break; - - case 's': - flag_strict = 1; - break; - - case 'v': - flag_verbose = 1; - break; - } - } - while (opt_char != -1); - - if (optind == argc) - /* No command line arguments were provided. Filter stdin. */ - { - dyn_string_t mangled = dyn_string_new (3); - dyn_string_t demangled = dyn_string_new (0); - status_t status; - - /* Read all of input. */ - while (!feof (stdin)) - { - char c = getchar (); - - /* The first character of a mangled name is an underscore. */ - if (feof (stdin)) - break; - if (c != '_') - { - /* It's not a mangled name. Print the character and go - on. */ - putchar (c); - continue; - } - c = getchar (); - - /* The second character of a mangled name is a capital `Z'. */ - if (feof (stdin)) - break; - if (c != 'Z') - { - /* It's not a mangled name. Print the previous - underscore, the `Z', and go on. */ - putchar ('_'); - putchar (c); - continue; - } - - /* Start keeping track of the candidate mangled name. */ - dyn_string_append_char (mangled, '_'); - dyn_string_append_char (mangled, 'Z'); - - /* Pile characters into mangled until we hit one that can't - occur in a mangled name. */ - c = getchar (); - while (!feof (stdin) && is_mangled_char (c)) - { - dyn_string_append_char (mangled, c); - if (feof (stdin)) - break; - c = getchar (); - } - - /* Attempt to demangle the name. */ - status = cp_demangle (dyn_string_buf (mangled), demangled); - - /* If the demangling succeeded, great! Print out the - demangled version. */ - if (STATUS_NO_ERROR (status)) - fputs (dyn_string_buf (demangled), stdout); - /* Abort on allocation failures. */ - else if (status == STATUS_ALLOCATION_FAILED) - { - fprintf (stderr, "Memory allocation failed.\n"); - abort (); - } - /* Otherwise, it might not have been a mangled name. Just - print out the original text. */ - else - fputs (dyn_string_buf (mangled), stdout); - - /* If we haven't hit EOF yet, we've read one character that - can't occur in a mangled name, so print it out. */ - if (!feof (stdin)) - putchar (c); - - /* Clear the candidate mangled name, to start afresh next - time we hit a `_Z'. */ - dyn_string_clear (mangled); - } - - dyn_string_delete (mangled); - dyn_string_delete (demangled); - } - else - /* Demangle command line arguments. */ - { - dyn_string_t result = dyn_string_new (0); - - /* Loop over command line arguments. */ - for (i = optind; i < argc; ++i) - { - /* Attempt to demangle. */ - status = cp_demangle (argv[i], result); - - /* If it worked, print the demangled name. */ - if (STATUS_NO_ERROR (status)) - printf ("%s\n", dyn_string_buf (result)); - /* Abort on allocaiton failures. */ - else if (status == STATUS_ALLOCATION_FAILED) - { - fprintf (stderr, "Memory allocaiton failed.\n"); - abort (); - } - /* If not, print the error message to stderr instead. */ - else - fprintf (stderr, "%s\n", status); - } - dyn_string_delete (result); - } - - return 0; -} - -#endif /* STANDALONE_DEMANGLER */ diff --git a/gnu/egcs/libiberty/cplus-dem.c b/gnu/egcs/libiberty/cplus-dem.c deleted file mode 100644 index ff6625244df..00000000000 --- a/gnu/egcs/libiberty/cplus-dem.c +++ /dev/null @@ -1,4692 +0,0 @@ -/* Demangler for GNU C++ - Copyright 1989, 91, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. - Written by James Clark (jjc@jclark.uucp) - Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling - Modified by Satish Pai (pai@apollo.hp.com) for HP demangling - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* This file exports two functions; cplus_mangle_opname and cplus_demangle. - - This file imports xmalloc and xrealloc, which are like malloc and - realloc except that they generate a fatal error if there is no - available memory. */ - -/* This file lives in both GCC and libiberty. When making changes, please - try not to break either. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <ctype.h> -#include <sys/types.h> -#include <string.h> -#include <stdio.h> - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#else -char * malloc (); -char * realloc (); -#endif - -#include <demangle.h> -#undef CURRENT_DEMANGLING_STYLE -#define CURRENT_DEMANGLING_STYLE work->options - -#include "libiberty.h" - -#define min(X,Y) (((X) < (Y)) ? (X) : (Y)) - -static const char *mystrstr PARAMS ((const char *, const char *)); - -static const char * -mystrstr (s1, s2) - const char *s1, *s2; -{ - register const char *p = s1; - register int len = strlen (s2); - - for (; (p = strchr (p, *s2)) != 0; p++) - { - if (strncmp (p, s2, len) == 0) - { - return (p); - } - } - return (0); -} - -/* In order to allow a single demangler executable to demangle strings - using various common values of CPLUS_MARKER, as well as any specific - one set at compile time, we maintain a string containing all the - commonly used ones, and check to see if the marker we are looking for - is in that string. CPLUS_MARKER is usually '$' on systems where the - assembler can deal with that. Where the assembler can't, it's usually - '.' (but on many systems '.' is used for other things). We put the - current defined CPLUS_MARKER first (which defaults to '$'), followed - by the next most common value, followed by an explicit '$' in case - the value of CPLUS_MARKER is not '$'. - - We could avoid this if we could just get g++ to tell us what the actual - cplus marker character is as part of the debug information, perhaps by - ensuring that it is the character that terminates the gcc<n>_compiled - marker symbol (FIXME). */ - -#if !defined (CPLUS_MARKER) -#define CPLUS_MARKER '$' -#endif - -enum demangling_styles current_demangling_style = gnu_demangling; - -static char cplus_markers[] = { CPLUS_MARKER, '.', '$', '\0' }; - -static char char_str[2] = { '\000', '\000' }; - -void -set_cplus_marker_for_demangling (ch) - int ch; -{ - cplus_markers[0] = ch; -} - -typedef struct string /* Beware: these aren't required to be */ -{ /* '\0' terminated. */ - char *b; /* pointer to start of string */ - char *p; /* pointer after last character */ - char *e; /* pointer after end of allocated space */ -} string; - -/* Stuff that is shared between sub-routines. - Using a shared structure allows cplus_demangle to be reentrant. */ - -struct work_stuff -{ - int options; - char **typevec; - char **ktypevec; - char **btypevec; - int numk; - int numb; - int ksize; - int bsize; - int ntypes; - int typevec_size; - int constructor; - int destructor; - int static_type; /* A static member function */ - int temp_start; /* index in demangled to start of template args */ - int type_quals; /* The type qualifiers. */ - int dllimported; /* Symbol imported from a PE DLL */ - char **tmpl_argvec; /* Template function arguments. */ - int ntmpl_args; /* The number of template function arguments. */ - int forgetting_types; /* Nonzero if we are not remembering the types - we see. */ - string* previous_argument; /* The last function argument demangled. */ - int nrepeats; /* The number of times to repeat the previous - argument. */ -}; - -#define PRINT_ANSI_QUALIFIERS (work -> options & DMGL_ANSI) -#define PRINT_ARG_TYPES (work -> options & DMGL_PARAMS) - -static const struct optable -{ - const char *in; - const char *out; - int flags; -} optable[] = { - {"nw", " new", DMGL_ANSI}, /* new (1.92, ansi) */ - {"dl", " delete", DMGL_ANSI}, /* new (1.92, ansi) */ - {"new", " new", 0}, /* old (1.91, and 1.x) */ - {"delete", " delete", 0}, /* old (1.91, and 1.x) */ - {"vn", " new []", DMGL_ANSI}, /* GNU, pending ansi */ - {"vd", " delete []", DMGL_ANSI}, /* GNU, pending ansi */ - {"as", "=", DMGL_ANSI}, /* ansi */ - {"ne", "!=", DMGL_ANSI}, /* old, ansi */ - {"eq", "==", DMGL_ANSI}, /* old, ansi */ - {"ge", ">=", DMGL_ANSI}, /* old, ansi */ - {"gt", ">", DMGL_ANSI}, /* old, ansi */ - {"le", "<=", DMGL_ANSI}, /* old, ansi */ - {"lt", "<", DMGL_ANSI}, /* old, ansi */ - {"plus", "+", 0}, /* old */ - {"pl", "+", DMGL_ANSI}, /* ansi */ - {"apl", "+=", DMGL_ANSI}, /* ansi */ - {"minus", "-", 0}, /* old */ - {"mi", "-", DMGL_ANSI}, /* ansi */ - {"ami", "-=", DMGL_ANSI}, /* ansi */ - {"mult", "*", 0}, /* old */ - {"ml", "*", DMGL_ANSI}, /* ansi */ - {"amu", "*=", DMGL_ANSI}, /* ansi (ARM/Lucid) */ - {"aml", "*=", DMGL_ANSI}, /* ansi (GNU/g++) */ - {"convert", "+", 0}, /* old (unary +) */ - {"negate", "-", 0}, /* old (unary -) */ - {"trunc_mod", "%", 0}, /* old */ - {"md", "%", DMGL_ANSI}, /* ansi */ - {"amd", "%=", DMGL_ANSI}, /* ansi */ - {"trunc_div", "/", 0}, /* old */ - {"dv", "/", DMGL_ANSI}, /* ansi */ - {"adv", "/=", DMGL_ANSI}, /* ansi */ - {"truth_andif", "&&", 0}, /* old */ - {"aa", "&&", DMGL_ANSI}, /* ansi */ - {"truth_orif", "||", 0}, /* old */ - {"oo", "||", DMGL_ANSI}, /* ansi */ - {"truth_not", "!", 0}, /* old */ - {"nt", "!", DMGL_ANSI}, /* ansi */ - {"postincrement","++", 0}, /* old */ - {"pp", "++", DMGL_ANSI}, /* ansi */ - {"postdecrement","--", 0}, /* old */ - {"mm", "--", DMGL_ANSI}, /* ansi */ - {"bit_ior", "|", 0}, /* old */ - {"or", "|", DMGL_ANSI}, /* ansi */ - {"aor", "|=", DMGL_ANSI}, /* ansi */ - {"bit_xor", "^", 0}, /* old */ - {"er", "^", DMGL_ANSI}, /* ansi */ - {"aer", "^=", DMGL_ANSI}, /* ansi */ - {"bit_and", "&", 0}, /* old */ - {"ad", "&", DMGL_ANSI}, /* ansi */ - {"aad", "&=", DMGL_ANSI}, /* ansi */ - {"bit_not", "~", 0}, /* old */ - {"co", "~", DMGL_ANSI}, /* ansi */ - {"call", "()", 0}, /* old */ - {"cl", "()", DMGL_ANSI}, /* ansi */ - {"alshift", "<<", 0}, /* old */ - {"ls", "<<", DMGL_ANSI}, /* ansi */ - {"als", "<<=", DMGL_ANSI}, /* ansi */ - {"arshift", ">>", 0}, /* old */ - {"rs", ">>", DMGL_ANSI}, /* ansi */ - {"ars", ">>=", DMGL_ANSI}, /* ansi */ - {"component", "->", 0}, /* old */ - {"pt", "->", DMGL_ANSI}, /* ansi; Lucid C++ form */ - {"rf", "->", DMGL_ANSI}, /* ansi; ARM/GNU form */ - {"indirect", "*", 0}, /* old */ - {"method_call", "->()", 0}, /* old */ - {"addr", "&", 0}, /* old (unary &) */ - {"array", "[]", 0}, /* old */ - {"vc", "[]", DMGL_ANSI}, /* ansi */ - {"compound", ", ", 0}, /* old */ - {"cm", ", ", DMGL_ANSI}, /* ansi */ - {"cond", "?:", 0}, /* old */ - {"cn", "?:", DMGL_ANSI}, /* pseudo-ansi */ - {"max", ">?", 0}, /* old */ - {"mx", ">?", DMGL_ANSI}, /* pseudo-ansi */ - {"min", "<?", 0}, /* old */ - {"mn", "<?", DMGL_ANSI}, /* pseudo-ansi */ - {"nop", "", 0}, /* old (for operator=) */ - {"rm", "->*", DMGL_ANSI}, /* ansi */ - {"sz", "sizeof ", DMGL_ANSI} /* pseudo-ansi */ -}; - -/* These values are used to indicate the various type varieties. - They are all non-zero so that they can be used as `success' - values. */ -typedef enum type_kind_t -{ - tk_none, - tk_pointer, - tk_reference, - tk_integral, - tk_bool, - tk_char, - tk_real -} type_kind_t; - -struct demangler_engine libiberty_demanglers[] = -{ - { - AUTO_DEMANGLING_STYLE_STRING, - auto_demangling, - "Automatic selection based on executable" - } - , - { - GNU_DEMANGLING_STYLE_STRING, - gnu_demangling, - "GNU (g++) style demangling" - } - , - { - LUCID_DEMANGLING_STYLE_STRING, - lucid_demangling, - "Lucid (lcc) style demangling" - } - , - { - ARM_DEMANGLING_STYLE_STRING, - arm_demangling, - "ARM style demangling" - } - , - { - HP_DEMANGLING_STYLE_STRING, - hp_demangling, - "HP (aCC) style demangling" - } - , - { - EDG_DEMANGLING_STYLE_STRING, - edg_demangling, - "EDG style demangling" - } - , - { - NULL, unknown_demangling, NULL - } -}; - -#define STRING_EMPTY(str) ((str) -> b == (str) -> p) -#define PREPEND_BLANK(str) {if (!STRING_EMPTY(str)) \ - string_prepend(str, " ");} -#define APPEND_BLANK(str) {if (!STRING_EMPTY(str)) \ - string_append(str, " ");} -#define LEN_STRING(str) ( (STRING_EMPTY(str))?0:((str)->p - (str)->b)) - -/* The scope separator appropriate for the language being demangled. */ - -#define SCOPE_STRING(work) ((work->options & DMGL_JAVA) ? "." : "::") - -#define ARM_VTABLE_STRING "__vtbl__" /* Lucid/ARM virtual table prefix */ -#define ARM_VTABLE_STRLEN 8 /* strlen (ARM_VTABLE_STRING) */ - -/* Prototypes for local functions */ - -static char * -mop_up PARAMS ((struct work_stuff *, string *, int)); - -static void -squangle_mop_up PARAMS ((struct work_stuff *)); - -#if 0 -static int -demangle_method_args PARAMS ((struct work_stuff *, const char **, string *)); -#endif - -static char * -internal_cplus_demangle PARAMS ((struct work_stuff *, const char *)); - -static int -demangle_template_template_parm PARAMS ((struct work_stuff *work, - const char **, string *)); - -static int -demangle_template PARAMS ((struct work_stuff *work, const char **, string *, - string *, int, int)); - -static int -arm_pt PARAMS ((struct work_stuff *, const char *, int, const char **, - const char **)); - -static int -demangle_class_name PARAMS ((struct work_stuff *, const char **, string *)); - -static int -demangle_qualified PARAMS ((struct work_stuff *, const char **, string *, - int, int)); - -static int -demangle_class PARAMS ((struct work_stuff *, const char **, string *)); - -static int -demangle_fund_type PARAMS ((struct work_stuff *, const char **, string *)); - -static int -demangle_signature PARAMS ((struct work_stuff *, const char **, string *)); - -static int -demangle_prefix PARAMS ((struct work_stuff *, const char **, string *)); - -static int -gnu_special PARAMS ((struct work_stuff *, const char **, string *)); - -static int -arm_special PARAMS ((const char **, string *)); - -static void -string_need PARAMS ((string *, int)); - -static void -string_delete PARAMS ((string *)); - -static void -string_init PARAMS ((string *)); - -static void -string_clear PARAMS ((string *)); - -#if 0 -static int -string_empty PARAMS ((string *)); -#endif - -static void -string_append PARAMS ((string *, const char *)); - -static void -string_appends PARAMS ((string *, string *)); - -static void -string_appendn PARAMS ((string *, const char *, int)); - -static void -string_prepend PARAMS ((string *, const char *)); - -static void -string_prependn PARAMS ((string *, const char *, int)); - -static int -get_count PARAMS ((const char **, int *)); - -static int -consume_count PARAMS ((const char **)); - -static int -consume_count_with_underscores PARAMS ((const char**)); - -static int -demangle_args PARAMS ((struct work_stuff *, const char **, string *)); - -static int -demangle_nested_args PARAMS ((struct work_stuff*, const char**, string*)); - -static int -do_type PARAMS ((struct work_stuff *, const char **, string *)); - -static int -do_arg PARAMS ((struct work_stuff *, const char **, string *)); - -static void -demangle_function_name PARAMS ((struct work_stuff *, const char **, string *, - const char *)); - -static void -remember_type PARAMS ((struct work_stuff *, const char *, int)); - -static void -remember_Btype PARAMS ((struct work_stuff *, const char *, int, int)); - -static int -register_Btype PARAMS ((struct work_stuff *)); - -static void -remember_Ktype PARAMS ((struct work_stuff *, const char *, int)); - -static void -forget_types PARAMS ((struct work_stuff *)); - -static void -forget_B_and_K_types PARAMS ((struct work_stuff *)); - -static void -string_prepends PARAMS ((string *, string *)); - -static int -demangle_template_value_parm PARAMS ((struct work_stuff*, const char**, - string*, type_kind_t)); - -static int -do_hpacc_template_const_value PARAMS ((struct work_stuff *, const char **, string *)); - -static int -do_hpacc_template_literal PARAMS ((struct work_stuff *, const char **, string *)); - -static int -snarf_numeric_literal PARAMS ((const char **, string *)); - -/* There is a TYPE_QUAL value for each type qualifier. They can be - combined by bitwise-or to form the complete set of qualifiers for a - type. */ - -#define TYPE_UNQUALIFIED 0x0 -#define TYPE_QUAL_CONST 0x1 -#define TYPE_QUAL_VOLATILE 0x2 -#define TYPE_QUAL_RESTRICT 0x4 - -static int -code_for_qualifier PARAMS ((int)); - -static const char* -qualifier_string PARAMS ((int)); - -static const char* -demangle_qualifier PARAMS ((int)); - -/* Translate count to integer, consuming tokens in the process. - Conversion terminates on the first non-digit character. - - Trying to consume something that isn't a count results in no - consumption of input and a return of -1. - - Overflow consumes the rest of the digits, and returns -1. */ - -static int -consume_count (type) - const char **type; -{ - int count = 0; - - if (! isdigit ((unsigned char)**type)) - return -1; - - while (isdigit ((unsigned char)**type)) - { - count *= 10; - - /* Check for overflow. - We assume that count is represented using two's-complement; - no power of two is divisible by ten, so if an overflow occurs - when multiplying by ten, the result will not be a multiple of - ten. */ - if ((count % 10) != 0) - { - while (isdigit ((unsigned char) **type)) - (*type)++; - return -1; - } - - count += **type - '0'; - (*type)++; - } - - return (count); -} - - -/* Like consume_count, but for counts that are preceded and followed - by '_' if they are greater than 10. Also, -1 is returned for - failure, since 0 can be a valid value. */ - -static int -consume_count_with_underscores (mangled) - const char **mangled; -{ - int idx; - - if (**mangled == '_') - { - (*mangled)++; - if (!isdigit ((unsigned char)**mangled)) - return -1; - - idx = consume_count (mangled); - if (**mangled != '_') - /* The trailing underscore was missing. */ - return -1; - - (*mangled)++; - } - else - { - if (**mangled < '0' || **mangled > '9') - return -1; - - idx = **mangled - '0'; - (*mangled)++; - } - - return idx; -} - -/* C is the code for a type-qualifier. Return the TYPE_QUAL - corresponding to this qualifier. */ - -static int -code_for_qualifier (c) - int c; -{ - switch (c) - { - case 'C': - return TYPE_QUAL_CONST; - - case 'V': - return TYPE_QUAL_VOLATILE; - - case 'u': - return TYPE_QUAL_RESTRICT; - - default: - break; - } - - /* C was an invalid qualifier. */ - abort (); -} - -/* Return the string corresponding to the qualifiers given by - TYPE_QUALS. */ - -static const char* -qualifier_string (type_quals) - int type_quals; -{ - switch (type_quals) - { - case TYPE_UNQUALIFIED: - return ""; - - case TYPE_QUAL_CONST: - return "const"; - - case TYPE_QUAL_VOLATILE: - return "volatile"; - - case TYPE_QUAL_RESTRICT: - return "__restrict"; - - case TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE: - return "const volatile"; - - case TYPE_QUAL_CONST | TYPE_QUAL_RESTRICT: - return "const __restrict"; - - case TYPE_QUAL_VOLATILE | TYPE_QUAL_RESTRICT: - return "volatile __restrict"; - - case TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE | TYPE_QUAL_RESTRICT: - return "const volatile __restrict"; - - default: - break; - } - - /* TYPE_QUALS was an invalid qualifier set. */ - abort (); -} - -/* C is the code for a type-qualifier. Return the string - corresponding to this qualifier. This function should only be - called with a valid qualifier code. */ - -static const char* -demangle_qualifier (c) - int c; -{ - return qualifier_string (code_for_qualifier (c)); -} - -int -cplus_demangle_opname (opname, result, options) - const char *opname; - char *result; - int options; -{ - int len, len1, ret; - string type; - struct work_stuff work[1]; - const char *tem; - - len = strlen(opname); - result[0] = '\0'; - ret = 0; - memset ((char *) work, 0, sizeof (work)); - work->options = options; - - if (opname[0] == '_' && opname[1] == '_' - && opname[2] == 'o' && opname[3] == 'p') - { - /* ANSI. */ - /* type conversion operator. */ - tem = opname + 4; - if (do_type (work, &tem, &type)) - { - strcat (result, "operator "); - strncat (result, type.b, type.p - type.b); - string_delete (&type); - ret = 1; - } - } - else if (opname[0] == '_' && opname[1] == '_' - && opname[2] >= 'a' && opname[2] <= 'z' - && opname[3] >= 'a' && opname[3] <= 'z') - { - if (opname[4] == '\0') - { - /* Operator. */ - size_t i; - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - if (strlen (optable[i].in) == 2 - && memcmp (optable[i].in, opname + 2, 2) == 0) - { - strcat (result, "operator"); - strcat (result, optable[i].out); - ret = 1; - break; - } - } - } - else - { - if (opname[2] == 'a' && opname[5] == '\0') - { - /* Assignment. */ - size_t i; - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - if (strlen (optable[i].in) == 3 - && memcmp (optable[i].in, opname + 2, 3) == 0) - { - strcat (result, "operator"); - strcat (result, optable[i].out); - ret = 1; - break; - } - } - } - } - } - else if (len >= 3 - && opname[0] == 'o' - && opname[1] == 'p' - && strchr (cplus_markers, opname[2]) != NULL) - { - /* see if it's an assignment expression */ - if (len >= 10 /* op$assign_ */ - && memcmp (opname + 3, "assign_", 7) == 0) - { - size_t i; - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - len1 = len - 10; - if ((int) strlen (optable[i].in) == len1 - && memcmp (optable[i].in, opname + 10, len1) == 0) - { - strcat (result, "operator"); - strcat (result, optable[i].out); - strcat (result, "="); - ret = 1; - break; - } - } - } - else - { - size_t i; - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - len1 = len - 3; - if ((int) strlen (optable[i].in) == len1 - && memcmp (optable[i].in, opname + 3, len1) == 0) - { - strcat (result, "operator"); - strcat (result, optable[i].out); - ret = 1; - break; - } - } - } - } - else if (len >= 5 && memcmp (opname, "type", 4) == 0 - && strchr (cplus_markers, opname[4]) != NULL) - { - /* type conversion operator */ - tem = opname + 5; - if (do_type (work, &tem, &type)) - { - strcat (result, "operator "); - strncat (result, type.b, type.p - type.b); - string_delete (&type); - ret = 1; - } - } - squangle_mop_up (work); - return ret; - -} -/* Takes operator name as e.g. "++" and returns mangled - operator name (e.g. "postincrement_expr"), or NULL if not found. - - If OPTIONS & DMGL_ANSI == 1, return the ANSI name; - if OPTIONS & DMGL_ANSI == 0, return the old GNU name. */ - -const char * -cplus_mangle_opname (opname, options) - const char *opname; - int options; -{ - size_t i; - int len; - - len = strlen (opname); - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - if ((int) strlen (optable[i].out) == len - && (options & DMGL_ANSI) == (optable[i].flags & DMGL_ANSI) - && memcmp (optable[i].out, opname, len) == 0) - return optable[i].in; - } - return (0); -} - -/* Add a routine to set the demangling style to be sure it is valid and - allow for any demangler initialization that maybe necessary. */ - -enum demangling_styles -cplus_demangle_set_style (style) - enum demangling_styles style; -{ - struct demangler_engine *demangler = libiberty_demanglers; - - for (; demangler->demangling_style != unknown_demangling; ++demangler) - if (style == demangler->demangling_style) - { - current_demangling_style = style; - return current_demangling_style; - } - - return unknown_demangling; -} - -/* Do string name to style translation */ - -enum demangling_styles -cplus_demangle_name_to_style (name) - const char *name; -{ - struct demangler_engine *demangler = libiberty_demanglers; - - for (; demangler->demangling_style != unknown_demangling; ++demangler) - if (strcmp (name, demangler->demangling_style_name) == 0) - return demangler->demangling_style; - - return unknown_demangling; -} - -/* char *cplus_demangle (const char *mangled, int options) - - If MANGLED is a mangled function name produced by GNU C++, then - a pointer to a malloced string giving a C++ representation - of the name will be returned; otherwise NULL will be returned. - It is the caller's responsibility to free the string which - is returned. - - The OPTIONS arg may contain one or more of the following bits: - - DMGL_ANSI ANSI qualifiers such as `const' and `void' are - included. - DMGL_PARAMS Function parameters are included. - - For example, - - cplus_demangle ("foo__1Ai", DMGL_PARAMS) => "A::foo(int)" - cplus_demangle ("foo__1Ai", DMGL_PARAMS | DMGL_ANSI) => "A::foo(int)" - cplus_demangle ("foo__1Ai", 0) => "A::foo" - - cplus_demangle ("foo__1Afe", DMGL_PARAMS) => "A::foo(float,...)" - cplus_demangle ("foo__1Afe", DMGL_PARAMS | DMGL_ANSI)=> "A::foo(float,...)" - cplus_demangle ("foo__1Afe", 0) => "A::foo" - - Note that any leading underscores, or other such characters prepended by - the compilation system, are presumed to have already been stripped from - MANGLED. */ - -char * -cplus_demangle (mangled, options) - const char *mangled; - int options; -{ - char *ret; - struct work_stuff work[1]; - memset ((char *) work, 0, sizeof (work)); - work -> options = options; - if ((work -> options & DMGL_STYLE_MASK) == 0) - work -> options |= (int) current_demangling_style & DMGL_STYLE_MASK; - - ret = internal_cplus_demangle (work, mangled); - squangle_mop_up (work); - return (ret); -} - - -/* This function performs most of what cplus_demangle use to do, but - to be able to demangle a name with a B, K or n code, we need to - have a longer term memory of what types have been seen. The original - now intializes and cleans up the squangle code info, while internal - calls go directly to this routine to avoid resetting that info. */ - -static char * -internal_cplus_demangle (work, mangled) - struct work_stuff *work; - const char *mangled; -{ - - string decl; - int success = 0; - char *demangled = NULL; - int s1,s2,s3,s4; - s1 = work->constructor; - s2 = work->destructor; - s3 = work->static_type; - s4 = work->type_quals; - work->constructor = work->destructor = 0; - work->type_quals = TYPE_UNQUALIFIED; - work->dllimported = 0; - - if ((mangled != NULL) && (*mangled != '\0')) - { - string_init (&decl); - - /* First check to see if gnu style demangling is active and if the - string to be demangled contains a CPLUS_MARKER. If so, attempt to - recognize one of the gnu special forms rather than looking for a - standard prefix. In particular, don't worry about whether there - is a "__" string in the mangled string. Consider "_$_5__foo" for - example. */ - - if ((AUTO_DEMANGLING || GNU_DEMANGLING)) - { - success = gnu_special (work, &mangled, &decl); - } - if (!success) - { - success = demangle_prefix (work, &mangled, &decl); - } - if (success && (*mangled != '\0')) - { - success = demangle_signature (work, &mangled, &decl); - } - if (work->constructor == 2) - { - string_prepend (&decl, "global constructors keyed to "); - work->constructor = 0; - } - else if (work->destructor == 2) - { - string_prepend (&decl, "global destructors keyed to "); - work->destructor = 0; - } - else if (work->dllimported == 1) - { - string_prepend (&decl, "import stub for "); - work->dllimported = 0; - } - demangled = mop_up (work, &decl, success); - } - work->constructor = s1; - work->destructor = s2; - work->static_type = s3; - work->type_quals = s4; - return (demangled); -} - - -/* Clear out and squangling related storage */ -static void -squangle_mop_up (work) - struct work_stuff *work; -{ - /* clean up the B and K type mangling types. */ - forget_B_and_K_types (work); - if (work -> btypevec != NULL) - { - free ((char *) work -> btypevec); - } - if (work -> ktypevec != NULL) - { - free ((char *) work -> ktypevec); - } -} - -/* Clear out any mangled storage */ - -static char * -mop_up (work, declp, success) - struct work_stuff *work; - string *declp; - int success; -{ - char *demangled = NULL; - - /* Discard the remembered types, if any. */ - - forget_types (work); - if (work -> typevec != NULL) - { - free ((char *) work -> typevec); - work -> typevec = NULL; - work -> typevec_size = 0; - } - if (work->tmpl_argvec) - { - int i; - - for (i = 0; i < work->ntmpl_args; i++) - if (work->tmpl_argvec[i]) - free ((char*) work->tmpl_argvec[i]); - - free ((char*) work->tmpl_argvec); - work->tmpl_argvec = NULL; - } - if (work->previous_argument) - { - string_delete (work->previous_argument); - free ((char*) work->previous_argument); - work->previous_argument = NULL; - } - - /* If demangling was successful, ensure that the demangled string is null - terminated and return it. Otherwise, free the demangling decl. */ - - if (!success) - { - string_delete (declp); - } - else - { - string_appendn (declp, "", 1); - demangled = declp -> b; - } - return (demangled); -} - -/* - -LOCAL FUNCTION - - demangle_signature -- demangle the signature part of a mangled name - -SYNOPSIS - - static int - demangle_signature (struct work_stuff *work, const char **mangled, - string *declp); - -DESCRIPTION - - Consume and demangle the signature portion of the mangled name. - - DECLP is the string where demangled output is being built. At - entry it contains the demangled root name from the mangled name - prefix. I.E. either a demangled operator name or the root function - name. In some special cases, it may contain nothing. - - *MANGLED points to the current unconsumed location in the mangled - name. As tokens are consumed and demangling is performed, the - pointer is updated to continuously point at the next token to - be consumed. - - Demangling GNU style mangled names is nasty because there is no - explicit token that marks the start of the outermost function - argument list. */ - -static int -demangle_signature (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int success = 1; - int func_done = 0; - int expect_func = 0; - int expect_return_type = 0; - const char *oldmangled = NULL; - string trawname; - string tname; - - while (success && (**mangled != '\0')) - { - switch (**mangled) - { - case 'Q': - oldmangled = *mangled; - success = demangle_qualified (work, mangled, declp, 1, 0); - if (success) - remember_type (work, oldmangled, *mangled - oldmangled); - if (AUTO_DEMANGLING || GNU_DEMANGLING) - expect_func = 1; - oldmangled = NULL; - break; - - case 'K': - oldmangled = *mangled; - success = demangle_qualified (work, mangled, declp, 1, 0); - if (AUTO_DEMANGLING || GNU_DEMANGLING) - { - expect_func = 1; - } - oldmangled = NULL; - break; - - case 'S': - /* Static member function */ - if (oldmangled == NULL) - { - oldmangled = *mangled; - } - (*mangled)++; - work -> static_type = 1; - break; - - case 'C': - case 'V': - case 'u': - work->type_quals |= code_for_qualifier (**mangled); - - /* a qualified member function */ - if (oldmangled == NULL) - oldmangled = *mangled; - (*mangled)++; - break; - - case 'L': - /* Local class name follows after "Lnnn_" */ - if (HP_DEMANGLING) - { - while (**mangled && (**mangled != '_')) - (*mangled)++; - if (!**mangled) - success = 0; - else - (*mangled)++; - } - else - success = 0; - break; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - if (oldmangled == NULL) - { - oldmangled = *mangled; - } - work->temp_start = -1; /* uppermost call to demangle_class */ - success = demangle_class (work, mangled, declp); - if (success) - { - remember_type (work, oldmangled, *mangled - oldmangled); - } - if (AUTO_DEMANGLING || GNU_DEMANGLING || EDG_DEMANGLING) - { - /* EDG and others will have the "F", so we let the loop cycle - if we are looking at one. */ - if (**mangled != 'F') - expect_func = 1; - } - oldmangled = NULL; - break; - - case 'B': - { - string s; - success = do_type (work, mangled, &s); - if (success) - { - string_append (&s, SCOPE_STRING (work)); - string_prepends (declp, &s); - } - oldmangled = NULL; - expect_func = 1; - } - break; - - case 'F': - /* Function */ - /* ARM/HP style demangling includes a specific 'F' character after - the class name. For GNU style, it is just implied. So we can - safely just consume any 'F' at this point and be compatible - with either style. */ - - oldmangled = NULL; - func_done = 1; - (*mangled)++; - - /* For lucid/ARM/HP style we have to forget any types we might - have remembered up to this point, since they were not argument - types. GNU style considers all types seen as available for - back references. See comment in demangle_args() */ - - if (LUCID_DEMANGLING || ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING) - { - forget_types (work); - } - success = demangle_args (work, mangled, declp); - /* After picking off the function args, we expect to either - find the function return type (preceded by an '_') or the - end of the string. */ - if (success && (AUTO_DEMANGLING || EDG_DEMANGLING) && **mangled == '_') - { - ++(*mangled); - /* At this level, we do not care about the return type. */ - success = do_type (work, mangled, &tname); - string_delete (&tname); - } - - break; - - case 't': - /* G++ Template */ - string_init(&trawname); - string_init(&tname); - if (oldmangled == NULL) - { - oldmangled = *mangled; - } - success = demangle_template (work, mangled, &tname, - &trawname, 1, 1); - if (success) - { - remember_type (work, oldmangled, *mangled - oldmangled); - } - string_append (&tname, SCOPE_STRING (work)); - - string_prepends(declp, &tname); - if (work -> destructor & 1) - { - string_prepend (&trawname, "~"); - string_appends (declp, &trawname); - work->destructor -= 1; - } - if ((work->constructor & 1) || (work->destructor & 1)) - { - string_appends (declp, &trawname); - work->constructor -= 1; - } - string_delete(&trawname); - string_delete(&tname); - oldmangled = NULL; - expect_func = 1; - break; - - case '_': - if (GNU_DEMANGLING && expect_return_type) - { - /* Read the return type. */ - string return_type; - string_init (&return_type); - - (*mangled)++; - success = do_type (work, mangled, &return_type); - APPEND_BLANK (&return_type); - - string_prepends (declp, &return_type); - string_delete (&return_type); - break; - } - else - /* At the outermost level, we cannot have a return type specified, - so if we run into another '_' at this point we are dealing with - a mangled name that is either bogus, or has been mangled by - some algorithm we don't know how to deal with. So just - reject the entire demangling. */ - /* However, "_nnn" is an expected suffix for alternate entry point - numbered nnn for a function, with HP aCC, so skip over that - without reporting failure. pai/1997-09-04 */ - if (HP_DEMANGLING) - { - (*mangled)++; - while (**mangled && isdigit ((unsigned char)**mangled)) - (*mangled)++; - } - else - success = 0; - break; - - case 'H': - if (GNU_DEMANGLING) - { - /* A G++ template function. Read the template arguments. */ - success = demangle_template (work, mangled, declp, 0, 0, - 0); - if (!(work->constructor & 1)) - expect_return_type = 1; - (*mangled)++; - break; - } - else - /* fall through */ - {;} - - default: - if (AUTO_DEMANGLING || GNU_DEMANGLING) - { - /* Assume we have stumbled onto the first outermost function - argument token, and start processing args. */ - func_done = 1; - success = demangle_args (work, mangled, declp); - } - else - { - /* Non-GNU demanglers use a specific token to mark the start - of the outermost function argument tokens. Typically 'F', - for ARM/HP-demangling, for example. So if we find something - we are not prepared for, it must be an error. */ - success = 0; - } - break; - } - /* - if (AUTO_DEMANGLING || GNU_DEMANGLING) - */ - { - if (success && expect_func) - { - func_done = 1; - if (LUCID_DEMANGLING || ARM_DEMANGLING || EDG_DEMANGLING) - { - forget_types (work); - } - success = demangle_args (work, mangled, declp); - /* Since template include the mangling of their return types, - we must set expect_func to 0 so that we don't try do - demangle more arguments the next time we get here. */ - expect_func = 0; - } - } - } - if (success && !func_done) - { - if (AUTO_DEMANGLING || GNU_DEMANGLING) - { - /* With GNU style demangling, bar__3foo is 'foo::bar(void)', and - bar__3fooi is 'foo::bar(int)'. We get here when we find the - first case, and need to ensure that the '(void)' gets added to - the current declp. Note that with ARM/HP, the first case - represents the name of a static data member 'foo::bar', - which is in the current declp, so we leave it alone. */ - success = demangle_args (work, mangled, declp); - } - } - if (success && PRINT_ARG_TYPES) - { - if (work->static_type) - string_append (declp, " static"); - if (work->type_quals != TYPE_UNQUALIFIED) - { - APPEND_BLANK (declp); - string_append (declp, qualifier_string (work->type_quals)); - } - } - - return (success); -} - -#if 0 - -static int -demangle_method_args (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int success = 0; - - if (work -> static_type) - { - string_append (declp, *mangled + 1); - *mangled += strlen (*mangled); - success = 1; - } - else - { - success = demangle_args (work, mangled, declp); - } - return (success); -} - -#endif - -static int -demangle_template_template_parm (work, mangled, tname) - struct work_stuff *work; - const char **mangled; - string *tname; -{ - int i; - int r; - int need_comma = 0; - int success = 1; - string temp; - - string_append (tname, "template <"); - /* get size of template parameter list */ - if (get_count (mangled, &r)) - { - for (i = 0; i < r; i++) - { - if (need_comma) - { - string_append (tname, ", "); - } - - /* Z for type parameters */ - if (**mangled == 'Z') - { - (*mangled)++; - string_append (tname, "class"); - } - /* z for template parameters */ - else if (**mangled == 'z') - { - (*mangled)++; - success = - demangle_template_template_parm (work, mangled, tname); - if (!success) - { - break; - } - } - else - { - /* temp is initialized in do_type */ - success = do_type (work, mangled, &temp); - if (success) - { - string_appends (tname, &temp); - } - string_delete(&temp); - if (!success) - { - break; - } - } - need_comma = 1; - } - - } - if (tname->p[-1] == '>') - string_append (tname, " "); - string_append (tname, "> class"); - return (success); -} - -static int -demangle_integral_value (work, mangled, s) - struct work_stuff *work; - const char** mangled; - string* s; -{ - int success; - - if (**mangled == 'E') - { - int need_operator = 0; - - success = 1; - string_appendn (s, "(", 1); - (*mangled)++; - while (success && **mangled != 'W' && **mangled != '\0') - { - if (need_operator) - { - size_t i; - size_t len; - - success = 0; - - len = strlen (*mangled); - - for (i = 0; - i < sizeof (optable) / sizeof (optable [0]); - ++i) - { - size_t l = strlen (optable[i].in); - - if (l <= len - && memcmp (optable[i].in, *mangled, l) == 0) - { - string_appendn (s, " ", 1); - string_append (s, optable[i].out); - string_appendn (s, " ", 1); - success = 1; - (*mangled) += l; - break; - } - } - - if (!success) - break; - } - else - need_operator = 1; - - success = demangle_template_value_parm (work, mangled, s, - tk_integral); - } - - if (**mangled != 'W') - success = 0; - else - { - string_appendn (s, ")", 1); - (*mangled)++; - } - } - else if (**mangled == 'Q' || **mangled == 'K') - success = demangle_qualified (work, mangled, s, 0, 1); - else - { - success = 0; - - if (**mangled == 'm') - { - string_appendn (s, "-", 1); - (*mangled)++; - } - while (isdigit ((unsigned char)**mangled)) - { - string_appendn (s, *mangled, 1); - (*mangled)++; - success = 1; - } - } - - return success; -} - -static int -demangle_template_value_parm (work, mangled, s, tk) - struct work_stuff *work; - const char **mangled; - string* s; - type_kind_t tk; -{ - int success = 1; - - if (**mangled == 'Y') - { - /* The next argument is a template parameter. */ - int idx; - - (*mangled)++; - idx = consume_count_with_underscores (mangled); - if (idx == -1 - || (work->tmpl_argvec && idx >= work->ntmpl_args) - || consume_count_with_underscores (mangled) == -1) - return -1; - if (work->tmpl_argvec) - string_append (s, work->tmpl_argvec[idx]); - else - { - char buf[10]; - sprintf(buf, "T%d", idx); - string_append (s, buf); - } - } - else if (tk == tk_integral) - success = demangle_integral_value (work, mangled, s); - else if (tk == tk_char) - { - char tmp[2]; - int val; - if (**mangled == 'm') - { - string_appendn (s, "-", 1); - (*mangled)++; - } - string_appendn (s, "'", 1); - val = consume_count(mangled); - if (val <= 0) - success = 0; - else - { - tmp[0] = (char)val; - tmp[1] = '\0'; - string_appendn (s, &tmp[0], 1); - string_appendn (s, "'", 1); - } - } - else if (tk == tk_bool) - { - int val = consume_count (mangled); - if (val == 0) - string_appendn (s, "false", 5); - else if (val == 1) - string_appendn (s, "true", 4); - else - success = 0; - } - else if (tk == tk_real) - { - if (**mangled == 'm') - { - string_appendn (s, "-", 1); - (*mangled)++; - } - while (isdigit ((unsigned char)**mangled)) - { - string_appendn (s, *mangled, 1); - (*mangled)++; - } - if (**mangled == '.') /* fraction */ - { - string_appendn (s, ".", 1); - (*mangled)++; - while (isdigit ((unsigned char)**mangled)) - { - string_appendn (s, *mangled, 1); - (*mangled)++; - } - } - if (**mangled == 'e') /* exponent */ - { - string_appendn (s, "e", 1); - (*mangled)++; - while (isdigit ((unsigned char)**mangled)) - { - string_appendn (s, *mangled, 1); - (*mangled)++; - } - } - } - else if (tk == tk_pointer || tk == tk_reference) - { - if (**mangled == 'Q') - success = demangle_qualified (work, mangled, s, - /*isfuncname=*/0, - /*append=*/1); - else - { - int symbol_len = consume_count (mangled); - if (symbol_len == -1) - return -1; - if (symbol_len == 0) - string_appendn (s, "0", 1); - else - { - char *p = xmalloc (symbol_len + 1), *q; - strncpy (p, *mangled, symbol_len); - p [symbol_len] = '\0'; - /* We use cplus_demangle here, rather than - internal_cplus_demangle, because the name of the entity - mangled here does not make use of any of the squangling - or type-code information we have built up thus far; it is - mangled independently. */ - q = cplus_demangle (p, work->options); - if (tk == tk_pointer) - string_appendn (s, "&", 1); - /* FIXME: Pointer-to-member constants should get a - qualifying class name here. */ - if (q) - { - string_append (s, q); - free (q); - } - else - string_append (s, p); - free (p); - } - *mangled += symbol_len; - } - } - - return success; -} - -/* Demangle the template name in MANGLED. The full name of the - template (e.g., S<int>) is placed in TNAME. The name without the - template parameters (e.g. S) is placed in TRAWNAME if TRAWNAME is - non-NULL. If IS_TYPE is nonzero, this template is a type template, - not a function template. If both IS_TYPE and REMEMBER are nonzero, - the tmeplate is remembered in the list of back-referenceable - types. */ - -static int -demangle_template (work, mangled, tname, trawname, is_type, remember) - struct work_stuff *work; - const char **mangled; - string *tname; - string *trawname; - int is_type; - int remember; -{ - int i; - int r; - int need_comma = 0; - int success = 0; - const char *start; - int is_java_array = 0; - string temp; - int bindex = 0; - - (*mangled)++; - if (is_type) - { - if (remember) - bindex = register_Btype (work); - start = *mangled; - /* get template name */ - if (**mangled == 'z') - { - int idx; - (*mangled)++; - (*mangled)++; - - idx = consume_count_with_underscores (mangled); - if (idx == -1 - || (work->tmpl_argvec && idx >= work->ntmpl_args) - || consume_count_with_underscores (mangled) == -1) - return (0); - - if (work->tmpl_argvec) - { - string_append (tname, work->tmpl_argvec[idx]); - if (trawname) - string_append (trawname, work->tmpl_argvec[idx]); - } - else - { - char buf[10]; - sprintf(buf, "T%d", idx); - string_append (tname, buf); - if (trawname) - string_append (trawname, buf); - } - } - else - { - if ((r = consume_count (mangled)) <= 0 - || (int) strlen (*mangled) < r) - { - return (0); - } - is_java_array = (work -> options & DMGL_JAVA) - && strncmp (*mangled, "JArray1Z", 8) == 0; - if (! is_java_array) - { - string_appendn (tname, *mangled, r); - } - if (trawname) - string_appendn (trawname, *mangled, r); - *mangled += r; - } - } - if (!is_java_array) - string_append (tname, "<"); - /* get size of template parameter list */ - if (!get_count (mangled, &r)) - { - return (0); - } - if (!is_type) - { - /* Create an array for saving the template argument values. */ - work->tmpl_argvec = (char**) xmalloc (r * sizeof (char *)); - work->ntmpl_args = r; - for (i = 0; i < r; i++) - work->tmpl_argvec[i] = 0; - } - for (i = 0; i < r; i++) - { - if (need_comma) - { - string_append (tname, ", "); - } - /* Z for type parameters */ - if (**mangled == 'Z') - { - (*mangled)++; - /* temp is initialized in do_type */ - success = do_type (work, mangled, &temp); - if (success) - { - string_appends (tname, &temp); - - if (!is_type) - { - /* Save the template argument. */ - int len = temp.p - temp.b; - work->tmpl_argvec[i] = xmalloc (len + 1); - memcpy (work->tmpl_argvec[i], temp.b, len); - work->tmpl_argvec[i][len] = '\0'; - } - } - string_delete(&temp); - if (!success) - { - break; - } - } - /* z for template parameters */ - else if (**mangled == 'z') - { - int r2; - (*mangled)++; - success = demangle_template_template_parm (work, mangled, tname); - - if (success - && (r2 = consume_count (mangled)) > 0 - && (int) strlen (*mangled) >= r2) - { - string_append (tname, " "); - string_appendn (tname, *mangled, r2); - if (!is_type) - { - /* Save the template argument. */ - int len = r2; - work->tmpl_argvec[i] = xmalloc (len + 1); - memcpy (work->tmpl_argvec[i], *mangled, len); - work->tmpl_argvec[i][len] = '\0'; - } - *mangled += r2; - } - if (!success) - { - break; - } - } - else - { - string param; - string* s; - - /* otherwise, value parameter */ - - /* temp is initialized in do_type */ - success = do_type (work, mangled, &temp); - string_delete(&temp); - if (!success) - break; - - if (!is_type) - { - s = ¶m; - string_init (s); - } - else - s = tname; - - success = demangle_template_value_parm (work, mangled, s, - (type_kind_t) success); - - if (!success) - { - if (!is_type) - string_delete (s); - success = 0; - break; - } - - if (!is_type) - { - int len = s->p - s->b; - work->tmpl_argvec[i] = xmalloc (len + 1); - memcpy (work->tmpl_argvec[i], s->b, len); - work->tmpl_argvec[i][len] = '\0'; - - string_appends (tname, s); - string_delete (s); - } - } - need_comma = 1; - } - if (is_java_array) - { - string_append (tname, "[]"); - } - else - { - if (tname->p[-1] == '>') - string_append (tname, " "); - string_append (tname, ">"); - } - - if (is_type && remember) - remember_Btype (work, tname->b, LEN_STRING (tname), bindex); - - /* - if (work -> static_type) - { - string_append (declp, *mangled + 1); - *mangled += strlen (*mangled); - success = 1; - } - else - { - success = demangle_args (work, mangled, declp); - } - } - */ - return (success); -} - -static int -arm_pt (work, mangled, n, anchor, args) - struct work_stuff *work; - const char *mangled; - int n; - const char **anchor, **args; -{ - /* Check if ARM template with "__pt__" in it ("parameterized type") */ - /* Allow HP also here, because HP's cfront compiler follows ARM to some extent */ - if ((ARM_DEMANGLING || HP_DEMANGLING) && (*anchor = mystrstr (mangled, "__pt__"))) - { - int len; - *args = *anchor + 6; - len = consume_count (args); - if (len == -1) - return 0; - if (*args + len == mangled + n && **args == '_') - { - ++*args; - return 1; - } - } - if (AUTO_DEMANGLING || EDG_DEMANGLING) - { - if ((*anchor = mystrstr (mangled, "__tm__")) - || (*anchor = mystrstr (mangled, "__ps__")) - || (*anchor = mystrstr (mangled, "__pt__"))) - { - int len; - *args = *anchor + 6; - len = consume_count (args); - if (len == -1) - return 0; - if (*args + len == mangled + n && **args == '_') - { - ++*args; - return 1; - } - } - else if ((*anchor = mystrstr (mangled, "__S"))) - { - int len; - *args = *anchor + 3; - len = consume_count (args); - if (len == -1) - return 0; - if (*args + len == mangled + n && **args == '_') - { - ++*args; - return 1; - } - } - } - - return 0; -} - -static void -demangle_arm_hp_template (work, mangled, n, declp) - struct work_stuff *work; - const char **mangled; - int n; - string *declp; -{ - const char *p; - const char *args; - const char *e = *mangled + n; - string arg; - - /* Check for HP aCC template spec: classXt1t2 where t1, t2 are - template args */ - if (HP_DEMANGLING && ((*mangled)[n] == 'X')) - { - char *start_spec_args = NULL; - - /* First check for and omit template specialization pseudo-arguments, - such as in "Spec<#1,#1.*>" */ - start_spec_args = strchr (*mangled, '<'); - if (start_spec_args && (start_spec_args - *mangled < n)) - string_appendn (declp, *mangled, start_spec_args - *mangled); - else - string_appendn (declp, *mangled, n); - (*mangled) += n + 1; - string_init (&arg); - if (work->temp_start == -1) /* non-recursive call */ - work->temp_start = declp->p - declp->b; - string_append (declp, "<"); - while (1) - { - string_clear (&arg); - switch (**mangled) - { - case 'T': - /* 'T' signals a type parameter */ - (*mangled)++; - if (!do_type (work, mangled, &arg)) - goto hpacc_template_args_done; - break; - - case 'U': - case 'S': - /* 'U' or 'S' signals an integral value */ - if (!do_hpacc_template_const_value (work, mangled, &arg)) - goto hpacc_template_args_done; - break; - - case 'A': - /* 'A' signals a named constant expression (literal) */ - if (!do_hpacc_template_literal (work, mangled, &arg)) - goto hpacc_template_args_done; - break; - - default: - /* Today, 1997-09-03, we have only the above types - of template parameters */ - /* FIXME: maybe this should fail and return null */ - goto hpacc_template_args_done; - } - string_appends (declp, &arg); - /* Check if we're at the end of template args. - 0 if at end of static member of template class, - _ if done with template args for a function */ - if ((**mangled == '\000') || (**mangled == '_')) - break; - else - string_append (declp, ","); - } - hpacc_template_args_done: - string_append (declp, ">"); - string_delete (&arg); - if (**mangled == '_') - (*mangled)++; - return; - } - /* ARM template? (Also handles HP cfront extensions) */ - else if (arm_pt (work, *mangled, n, &p, &args)) - { - string type_str; - - string_init (&arg); - string_appendn (declp, *mangled, p - *mangled); - if (work->temp_start == -1) /* non-recursive call */ - work->temp_start = declp->p - declp->b; - string_append (declp, "<"); - /* should do error checking here */ - while (args < e) { - string_clear (&arg); - - /* Check for type or literal here */ - switch (*args) - { - /* HP cfront extensions to ARM for template args */ - /* spec: Xt1Lv1 where t1 is a type, v1 is a literal value */ - /* FIXME: We handle only numeric literals for HP cfront */ - case 'X': - /* A typed constant value follows */ - args++; - if (!do_type (work, &args, &type_str)) - goto cfront_template_args_done; - string_append (&arg, "("); - string_appends (&arg, &type_str); - string_append (&arg, ")"); - if (*args != 'L') - goto cfront_template_args_done; - args++; - /* Now snarf a literal value following 'L' */ - if (!snarf_numeric_literal (&args, &arg)) - goto cfront_template_args_done; - break; - - case 'L': - /* Snarf a literal following 'L' */ - args++; - if (!snarf_numeric_literal (&args, &arg)) - goto cfront_template_args_done; - break; - default: - /* Not handling other HP cfront stuff */ - if (!do_type (work, &args, &arg)) - goto cfront_template_args_done; - } - string_appends (declp, &arg); - string_append (declp, ","); - } - cfront_template_args_done: - string_delete (&arg); - if (args >= e) - --declp->p; /* remove extra comma */ - string_append (declp, ">"); - } - else if (n>10 && strncmp (*mangled, "_GLOBAL_", 8) == 0 - && (*mangled)[9] == 'N' - && (*mangled)[8] == (*mangled)[10] - && strchr (cplus_markers, (*mangled)[8])) - { - /* A member of the anonymous namespace. */ - string_append (declp, "{anonymous}"); - } - else - { - if (work->temp_start == -1) /* non-recursive call only */ - work->temp_start = 0; /* disable in recursive calls */ - string_appendn (declp, *mangled, n); - } - *mangled += n; -} - -/* Extract a class name, possibly a template with arguments, from the - mangled string; qualifiers, local class indicators, etc. have - already been dealt with */ - -static int -demangle_class_name (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int n; - int success = 0; - - n = consume_count (mangled); - if (n == -1) - return 0; - if ((int) strlen (*mangled) >= n) - { - demangle_arm_hp_template (work, mangled, n, declp); - success = 1; - } - - return (success); -} - -/* - -LOCAL FUNCTION - - demangle_class -- demangle a mangled class sequence - -SYNOPSIS - - static int - demangle_class (struct work_stuff *work, const char **mangled, - strint *declp) - -DESCRIPTION - - DECLP points to the buffer into which demangling is being done. - - *MANGLED points to the current token to be demangled. On input, - it points to a mangled class (I.E. "3foo", "13verylongclass", etc.) - On exit, it points to the next token after the mangled class on - success, or the first unconsumed token on failure. - - If the CONSTRUCTOR or DESTRUCTOR flags are set in WORK, then - we are demangling a constructor or destructor. In this case - we prepend "class::class" or "class::~class" to DECLP. - - Otherwise, we prepend "class::" to the current DECLP. - - Reset the constructor/destructor flags once they have been - "consumed". This allows demangle_class to be called later during - the same demangling, to do normal class demangling. - - Returns 1 if demangling is successful, 0 otherwise. - -*/ - -static int -demangle_class (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int success = 0; - int btype; - string class_name; - char *save_class_name_end = 0; - - string_init (&class_name); - btype = register_Btype (work); - if (demangle_class_name (work, mangled, &class_name)) - { - save_class_name_end = class_name.p; - if ((work->constructor & 1) || (work->destructor & 1)) - { - /* adjust so we don't include template args */ - if (work->temp_start && (work->temp_start != -1)) - { - class_name.p = class_name.b + work->temp_start; - } - string_prepends (declp, &class_name); - if (work -> destructor & 1) - { - string_prepend (declp, "~"); - work -> destructor -= 1; - } - else - { - work -> constructor -= 1; - } - } - class_name.p = save_class_name_end; - remember_Ktype (work, class_name.b, LEN_STRING(&class_name)); - remember_Btype (work, class_name.b, LEN_STRING(&class_name), btype); - string_prepend (declp, SCOPE_STRING (work)); - string_prepends (declp, &class_name); - success = 1; - } - string_delete (&class_name); - return (success); -} - -/* - -LOCAL FUNCTION - - demangle_prefix -- consume the mangled name prefix and find signature - -SYNOPSIS - - static int - demangle_prefix (struct work_stuff *work, const char **mangled, - string *declp); - -DESCRIPTION - - Consume and demangle the prefix of the mangled name. - - DECLP points to the string buffer into which demangled output is - placed. On entry, the buffer is empty. On exit it contains - the root function name, the demangled operator name, or in some - special cases either nothing or the completely demangled result. - - MANGLED points to the current pointer into the mangled name. As each - token of the mangled name is consumed, it is updated. Upon entry - the current mangled name pointer points to the first character of - the mangled name. Upon exit, it should point to the first character - of the signature if demangling was successful, or to the first - unconsumed character if demangling of the prefix was unsuccessful. - - Returns 1 on success, 0 otherwise. - */ - -static int -demangle_prefix (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int success = 1; - const char *scan; - int i; - - if (strlen(*mangled) > 6 - && (strncmp(*mangled, "_imp__", 6) == 0 - || strncmp(*mangled, "__imp_", 6) == 0)) - { - /* it's a symbol imported from a PE dynamic library. Check for both - new style prefix _imp__ and legacy __imp_ used by older versions - of dlltool. */ - (*mangled) += 6; - work->dllimported = 1; - } - else if (strlen(*mangled) >= 11 && strncmp(*mangled, "_GLOBAL_", 8) == 0) - { - char *marker = strchr (cplus_markers, (*mangled)[8]); - if (marker != NULL && *marker == (*mangled)[10]) - { - if ((*mangled)[9] == 'D') - { - /* it's a GNU global destructor to be executed at program exit */ - (*mangled) += 11; - work->destructor = 2; - if (gnu_special (work, mangled, declp)) - return success; - } - else if ((*mangled)[9] == 'I') - { - /* it's a GNU global constructor to be executed at program init */ - (*mangled) += 11; - work->constructor = 2; - if (gnu_special (work, mangled, declp)) - return success; - } - } - } - else if ((ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING) && strncmp(*mangled, "__std__", 7) == 0) - { - /* it's a ARM global destructor to be executed at program exit */ - (*mangled) += 7; - work->destructor = 2; - } - else if ((ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING) && strncmp(*mangled, "__sti__", 7) == 0) - { - /* it's a ARM global constructor to be executed at program initial */ - (*mangled) += 7; - work->constructor = 2; - } - - /* This block of code is a reduction in strength time optimization - of: - scan = mystrstr (*mangled, "__"); */ - - { - scan = *mangled; - - do { - scan = strchr (scan, '_'); - } while (scan != NULL && *++scan != '_'); - - if (scan != NULL) --scan; - } - - if (scan != NULL) - { - /* We found a sequence of two or more '_', ensure that we start at - the last pair in the sequence. */ - i = strspn (scan, "_"); - if (i > 2) - { - scan += (i - 2); - } - } - - if (scan == NULL) - { - success = 0; - } - else if (work -> static_type) - { - if (!isdigit ((unsigned char)scan[0]) && (scan[0] != 't')) - { - success = 0; - } - } - else if ((scan == *mangled) - && (isdigit ((unsigned char)scan[2]) || (scan[2] == 'Q') - || (scan[2] == 't') || (scan[2] == 'K') || (scan[2] == 'H'))) - { - /* The ARM says nothing about the mangling of local variables. - But cfront mangles local variables by prepending __<nesting_level> - to them. As an extension to ARM demangling we handle this case. */ - if ((LUCID_DEMANGLING || ARM_DEMANGLING || HP_DEMANGLING) - && isdigit ((unsigned char)scan[2])) - { - *mangled = scan + 2; - consume_count (mangled); - string_append (declp, *mangled); - *mangled += strlen (*mangled); - success = 1; - } - else - { - /* A GNU style constructor starts with __[0-9Qt]. But cfront uses - names like __Q2_3foo3bar for nested type names. So don't accept - this style of constructor for cfront demangling. A GNU - style member-template constructor starts with 'H'. */ - if (!(LUCID_DEMANGLING || ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING)) - work -> constructor += 1; - *mangled = scan + 2; - } - } - else if (ARM_DEMANGLING && scan[2] == 'p' && scan[3] == 't') - { - /* Cfront-style parameterized type. Handled later as a signature. */ - success = 1; - - /* ARM template? */ - demangle_arm_hp_template (work, mangled, strlen (*mangled), declp); - } - else if (EDG_DEMANGLING && ((scan[2] == 't' && scan[3] == 'm') - || (scan[2] == 'p' && scan[3] == 's') - || (scan[2] == 'p' && scan[3] == 't'))) - { - /* EDG-style parameterized type. Handled later as a signature. */ - success = 1; - - /* EDG template? */ - demangle_arm_hp_template (work, mangled, strlen (*mangled), declp); - } - else if ((scan == *mangled) && !isdigit ((unsigned char)scan[2]) - && (scan[2] != 't')) - { - /* Mangled name starts with "__". Skip over any leading '_' characters, - then find the next "__" that separates the prefix from the signature. - */ - if (!(ARM_DEMANGLING || LUCID_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING) - || (arm_special (mangled, declp) == 0)) - { - while (*scan == '_') - { - scan++; - } - if ((scan = mystrstr (scan, "__")) == NULL || (*(scan + 2) == '\0')) - { - /* No separator (I.E. "__not_mangled"), or empty signature - (I.E. "__not_mangled_either__") */ - success = 0; - } - else - { - const char *tmp; - - /* Look for the LAST occurrence of __, allowing names to - have the '__' sequence embedded in them. */ - if (!(ARM_DEMANGLING || HP_DEMANGLING)) - { - while ((tmp = mystrstr (scan + 2, "__")) != NULL) - scan = tmp; - } - if (*(scan + 2) == '\0') - success = 0; - else - demangle_function_name (work, mangled, declp, scan); - } - } - } - else if (*(scan + 2) != '\0') - { - /* Mangled name does not start with "__" but does have one somewhere - in there with non empty stuff after it. Looks like a global - function name. */ - demangle_function_name (work, mangled, declp, scan); - } - else - { - /* Doesn't look like a mangled name */ - success = 0; - } - - if (!success && (work->constructor == 2 || work->destructor == 2)) - { - string_append (declp, *mangled); - *mangled += strlen (*mangled); - success = 1; - } - return (success); -} - -/* - -LOCAL FUNCTION - - gnu_special -- special handling of gnu mangled strings - -SYNOPSIS - - static int - gnu_special (struct work_stuff *work, const char **mangled, - string *declp); - - -DESCRIPTION - - Process some special GNU style mangling forms that don't fit - the normal pattern. For example: - - _$_3foo (destructor for class foo) - _vt$foo (foo virtual table) - _vt$foo$bar (foo::bar virtual table) - __vt_foo (foo virtual table, new style with thunks) - _3foo$varname (static data member) - _Q22rs2tu$vw (static data member) - __t6vector1Zii (constructor with template) - __thunk_4__$_7ostream (virtual function thunk) - */ - -static int -gnu_special (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - int n; - int success = 1; - const char *p; - - if ((*mangled)[0] == '_' - && strchr (cplus_markers, (*mangled)[1]) != NULL - && (*mangled)[2] == '_') - { - /* Found a GNU style destructor, get past "_<CPLUS_MARKER>_" */ - (*mangled) += 3; - work -> destructor += 1; - } - else if ((*mangled)[0] == '_' - && (((*mangled)[1] == '_' - && (*mangled)[2] == 'v' - && (*mangled)[3] == 't' - && (*mangled)[4] == '_') - || ((*mangled)[1] == 'v' - && (*mangled)[2] == 't' - && strchr (cplus_markers, (*mangled)[3]) != NULL))) - { - /* Found a GNU style virtual table, get past "_vt<CPLUS_MARKER>" - and create the decl. Note that we consume the entire mangled - input string, which means that demangle_signature has no work - to do. */ - if ((*mangled)[2] == 'v') - (*mangled) += 5; /* New style, with thunks: "__vt_" */ - else - (*mangled) += 4; /* Old style, no thunks: "_vt<CPLUS_MARKER>" */ - while (**mangled != '\0') - { - switch (**mangled) - { - case 'Q': - case 'K': - success = demangle_qualified (work, mangled, declp, 0, 1); - break; - case 't': - success = demangle_template (work, mangled, declp, 0, 1, - 1); - break; - default: - if (isdigit((unsigned char)*mangled[0])) - { - n = consume_count(mangled); - /* We may be seeing a too-large size, or else a - ".<digits>" indicating a static local symbol. In - any case, declare victory and move on; *don't* try - to use n to allocate. */ - if (n > (int) strlen (*mangled)) - { - success = 1; - break; - } - } - else - { - n = strcspn (*mangled, cplus_markers); - } - string_appendn (declp, *mangled, n); - (*mangled) += n; - } - - p = strpbrk (*mangled, cplus_markers); - if (success && ((p == NULL) || (p == *mangled))) - { - if (p != NULL) - { - string_append (declp, SCOPE_STRING (work)); - (*mangled)++; - } - } - else - { - success = 0; - break; - } - } - if (success) - string_append (declp, " virtual table"); - } - else if ((*mangled)[0] == '_' - && (strchr("0123456789Qt", (*mangled)[1]) != NULL) - && (p = strpbrk (*mangled, cplus_markers)) != NULL) - { - /* static data member, "_3foo$varname" for example */ - (*mangled)++; - switch (**mangled) - { - case 'Q': - case 'K': - success = demangle_qualified (work, mangled, declp, 0, 1); - break; - case 't': - success = demangle_template (work, mangled, declp, 0, 1, 1); - break; - default: - n = consume_count (mangled); - if (n < 0 || n > strlen (*mangled)) - { - success = 0; - break; - } - string_appendn (declp, *mangled, n); - (*mangled) += n; - } - if (success && (p == *mangled)) - { - /* Consumed everything up to the cplus_marker, append the - variable name. */ - (*mangled)++; - string_append (declp, SCOPE_STRING (work)); - n = strlen (*mangled); - string_appendn (declp, *mangled, n); - (*mangled) += n; - } - else - { - success = 0; - } - } - else if (strncmp (*mangled, "__thunk_", 8) == 0) - { - int delta; - - (*mangled) += 8; - delta = consume_count (mangled); - if (delta == -1) - success = 0; - else - { - char *method = internal_cplus_demangle (work, ++*mangled); - - if (method) - { - char buf[50]; - sprintf (buf, "virtual function thunk (delta:%d) for ", -delta); - string_append (declp, buf); - string_append (declp, method); - free (method); - n = strlen (*mangled); - (*mangled) += n; - } - else - { - success = 0; - } - } - } - else if (strncmp (*mangled, "__t", 3) == 0 - && ((*mangled)[3] == 'i' || (*mangled)[3] == 'f')) - { - p = (*mangled)[3] == 'i' ? " type_info node" : " type_info function"; - (*mangled) += 4; - switch (**mangled) - { - case 'Q': - case 'K': - success = demangle_qualified (work, mangled, declp, 0, 1); - break; - case 't': - success = demangle_template (work, mangled, declp, 0, 1, 1); - break; - default: - success = demangle_fund_type (work, mangled, declp); - break; - } - if (success && **mangled != '\0') - success = 0; - if (success) - string_append (declp, p); - } - else - { - success = 0; - } - return (success); -} - -static void -recursively_demangle(work, mangled, result, namelength) - struct work_stuff *work; - const char **mangled; - string *result; - int namelength; -{ - char * recurse = (char *)NULL; - char * recurse_dem = (char *)NULL; - - recurse = (char *) xmalloc (namelength + 1); - memcpy (recurse, *mangled, namelength); - recurse[namelength] = '\000'; - - recurse_dem = cplus_demangle (recurse, work->options); - - if (recurse_dem) - { - string_append (result, recurse_dem); - free (recurse_dem); - } - else - { - string_appendn (result, *mangled, namelength); - } - free (recurse); - *mangled += namelength; -} - -/* - -LOCAL FUNCTION - - arm_special -- special handling of ARM/lucid mangled strings - -SYNOPSIS - - static int - arm_special (const char **mangled, - string *declp); - - -DESCRIPTION - - Process some special ARM style mangling forms that don't fit - the normal pattern. For example: - - __vtbl__3foo (foo virtual table) - __vtbl__3foo__3bar (bar::foo virtual table) - - */ - -static int -arm_special (mangled, declp) - const char **mangled; - string *declp; -{ - int n; - int success = 1; - const char *scan; - - if (strncmp (*mangled, ARM_VTABLE_STRING, ARM_VTABLE_STRLEN) == 0) - { - /* Found a ARM style virtual table, get past ARM_VTABLE_STRING - and create the decl. Note that we consume the entire mangled - input string, which means that demangle_signature has no work - to do. */ - scan = *mangled + ARM_VTABLE_STRLEN; - while (*scan != '\0') /* first check it can be demangled */ - { - n = consume_count (&scan); - if (n == -1) - { - return (0); /* no good */ - } - scan += n; - if (scan[0] == '_' && scan[1] == '_') - { - scan += 2; - } - } - (*mangled) += ARM_VTABLE_STRLEN; - while (**mangled != '\0') - { - n = consume_count (mangled); - if (n == -1 - || n > strlen (*mangled)) - return 0; - string_prependn (declp, *mangled, n); - (*mangled) += n; - if ((*mangled)[0] == '_' && (*mangled)[1] == '_') - { - string_prepend (declp, "::"); - (*mangled) += 2; - } - } - string_append (declp, " virtual table"); - } - else - { - success = 0; - } - return (success); -} - -/* - -LOCAL FUNCTION - - demangle_qualified -- demangle 'Q' qualified name strings - -SYNOPSIS - - static int - demangle_qualified (struct work_stuff *, const char *mangled, - string *result, int isfuncname, int append); - -DESCRIPTION - - Demangle a qualified name, such as "Q25Outer5Inner" which is - the mangled form of "Outer::Inner". The demangled output is - prepended or appended to the result string according to the - state of the append flag. - - If isfuncname is nonzero, then the qualified name we are building - is going to be used as a member function name, so if it is a - constructor or destructor function, append an appropriate - constructor or destructor name. I.E. for the above example, - the result for use as a constructor is "Outer::Inner::Inner" - and the result for use as a destructor is "Outer::Inner::~Inner". - -BUGS - - Numeric conversion is ASCII dependent (FIXME). - - */ - -static int -demangle_qualified (work, mangled, result, isfuncname, append) - struct work_stuff *work; - const char **mangled; - string *result; - int isfuncname; - int append; -{ - int qualifiers = 0; - int success = 1; - const char *p; - char num[2]; - string temp; - string last_name; - int bindex = register_Btype (work); - - /* We only make use of ISFUNCNAME if the entity is a constructor or - destructor. */ - isfuncname = (isfuncname - && ((work->constructor & 1) || (work->destructor & 1))); - - string_init (&temp); - string_init (&last_name); - - if ((*mangled)[0] == 'K') - { - /* Squangling qualified name reuse */ - int idx; - (*mangled)++; - idx = consume_count_with_underscores (mangled); - if (idx == -1 || idx >= work -> numk) - success = 0; - else - string_append (&temp, work -> ktypevec[idx]); - } - else - switch ((*mangled)[1]) - { - case '_': - /* GNU mangled name with more than 9 classes. The count is preceded - by an underscore (to distinguish it from the <= 9 case) and followed - by an underscore. */ - p = *mangled + 2; - qualifiers = atoi (p); - if (!isdigit ((unsigned char)*p) || *p == '0') - success = 0; - - /* Skip the digits. */ - while (isdigit ((unsigned char)*p)) - ++p; - - if (*p != '_') - success = 0; - - *mangled = p + 1; - break; - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - /* The count is in a single digit. */ - num[0] = (*mangled)[1]; - num[1] = '\0'; - qualifiers = atoi (num); - - /* If there is an underscore after the digit, skip it. This is - said to be for ARM-qualified names, but the ARM makes no - mention of such an underscore. Perhaps cfront uses one. */ - if ((*mangled)[2] == '_') - { - (*mangled)++; - } - (*mangled) += 2; - break; - - case '0': - default: - success = 0; - } - - if (!success) - return success; - - /* Pick off the names and collect them in the temp buffer in the order - in which they are found, separated by '::'. */ - - while (qualifiers-- > 0) - { - int remember_K = 1; - string_clear (&last_name); - - if (*mangled[0] == '_') - (*mangled)++; - - if (*mangled[0] == 't') - { - /* Here we always append to TEMP since we will want to use - the template name without the template parameters as a - constructor or destructor name. The appropriate - (parameter-less) value is returned by demangle_template - in LAST_NAME. We do not remember the template type here, - in order to match the G++ mangling algorithm. */ - success = demangle_template(work, mangled, &temp, - &last_name, 1, 0); - if (!success) - break; - } - else if (*mangled[0] == 'K') - { - int idx; - (*mangled)++; - idx = consume_count_with_underscores (mangled); - if (idx == -1 || idx >= work->numk) - success = 0; - else - string_append (&temp, work->ktypevec[idx]); - remember_K = 0; - - if (!success) break; - } - else - { - if (EDG_DEMANGLING) - { - int namelength; - /* Now recursively demangle the qualifier - * This is necessary to deal with templates in - * mangling styles like EDG */ - namelength = consume_count (mangled); - if (namelength == -1) - { - success = 0; - break; - } - recursively_demangle(work, mangled, &temp, namelength); - } - else - { - success = do_type (work, mangled, &last_name); - if (!success) - break; - string_appends (&temp, &last_name); - } - } - - if (remember_K) - remember_Ktype (work, temp.b, LEN_STRING (&temp)); - - if (qualifiers > 0) - string_append (&temp, SCOPE_STRING (work)); - } - - remember_Btype (work, temp.b, LEN_STRING (&temp), bindex); - - /* If we are using the result as a function name, we need to append - the appropriate '::' separated constructor or destructor name. - We do this here because this is the most convenient place, where - we already have a pointer to the name and the length of the name. */ - - if (isfuncname) - { - string_append (&temp, SCOPE_STRING (work)); - if (work -> destructor & 1) - string_append (&temp, "~"); - string_appends (&temp, &last_name); - } - - /* Now either prepend the temp buffer to the result, or append it, - depending upon the state of the append flag. */ - - if (append) - string_appends (result, &temp); - else - { - if (!STRING_EMPTY (result)) - string_append (&temp, SCOPE_STRING (work)); - string_prepends (result, &temp); - } - - string_delete (&last_name); - string_delete (&temp); - return (success); -} - -/* - -LOCAL FUNCTION - - get_count -- convert an ascii count to integer, consuming tokens - -SYNOPSIS - - static int - get_count (const char **type, int *count) - -DESCRIPTION - - Assume that *type points at a count in a mangled name; set - *count to its value, and set *type to the next character after - the count. There are some weird rules in effect here. - - If *type does not point at a string of digits, return zero. - - If *type points at a string of digits followed by an - underscore, set *count to their value as an integer, advance - *type to point *after the underscore, and return 1. - - If *type points at a string of digits not followed by an - underscore, consume only the first digit. Set *count to its - value as an integer, leave *type pointing after that digit, - and return 1. - - The excuse for this odd behavior: in the ARM and HP demangling - styles, a type can be followed by a repeat count of the form - `Nxy', where: - - `x' is a single digit specifying how many additional copies - of the type to append to the argument list, and - - `y' is one or more digits, specifying the zero-based index of - the first repeated argument in the list. Yes, as you're - unmangling the name you can figure this out yourself, but - it's there anyway. - - So, for example, in `bar__3fooFPiN51', the first argument is a - pointer to an integer (`Pi'), and then the next five arguments - are the same (`N5'), and the first repeat is the function's - second argument (`1'). -*/ - -static int -get_count (type, count) - const char **type; - int *count; -{ - const char *p; - int n; - - if (!isdigit ((unsigned char)**type)) - { - return (0); - } - else - { - *count = **type - '0'; - (*type)++; - if (isdigit ((unsigned char)**type)) - { - p = *type; - n = *count; - do - { - n *= 10; - n += *p - '0'; - p++; - } - while (isdigit ((unsigned char)*p)); - if (*p == '_') - { - *type = p + 1; - *count = n; - } - } - } - return (1); -} - -/* RESULT will be initialised here; it will be freed on failure. The - value returned is really a type_kind_t. */ - -static int -do_type (work, mangled, result) - struct work_stuff *work; - const char **mangled; - string *result; -{ - int n; - int done; - int success; - string decl; - const char *remembered_type; - int type_quals; - string btype; - type_kind_t tk = tk_none; - - string_init (&btype); - string_init (&decl); - string_init (result); - - done = 0; - success = 1; - while (success && !done) - { - int member; - switch (**mangled) - { - - /* A pointer type */ - case 'P': - case 'p': - (*mangled)++; - if (! (work -> options & DMGL_JAVA)) - string_prepend (&decl, "*"); - if (tk == tk_none) - tk = tk_pointer; - break; - - /* A reference type */ - case 'R': - (*mangled)++; - string_prepend (&decl, "&"); - if (tk == tk_none) - tk = tk_reference; - break; - - /* An array */ - case 'A': - { - ++(*mangled); - if (!STRING_EMPTY (&decl) - && (decl.b[0] == '*' || decl.b[0] == '&')) - { - string_prepend (&decl, "("); - string_append (&decl, ")"); - } - string_append (&decl, "["); - if (**mangled != '_') - success = demangle_template_value_parm (work, mangled, &decl, - tk_integral); - if (**mangled == '_') - ++(*mangled); - string_append (&decl, "]"); - break; - } - - /* A back reference to a previously seen type */ - case 'T': - (*mangled)++; - if (!get_count (mangled, &n) || n >= work -> ntypes) - { - success = 0; - } - else - { - remembered_type = work -> typevec[n]; - mangled = &remembered_type; - } - break; - - /* A function */ - case 'F': - (*mangled)++; - if (!STRING_EMPTY (&decl) - && (decl.b[0] == '*' || decl.b[0] == '&')) - { - string_prepend (&decl, "("); - string_append (&decl, ")"); - } - /* After picking off the function args, we expect to either find the - function return type (preceded by an '_') or the end of the - string. */ - if (!demangle_nested_args (work, mangled, &decl) - || (**mangled != '_' && **mangled != '\0')) - { - success = 0; - break; - } - if (success && (**mangled == '_')) - (*mangled)++; - break; - - case 'M': - case 'O': - { - type_quals = TYPE_UNQUALIFIED; - - member = **mangled == 'M'; - (*mangled)++; - - string_append (&decl, ")"); - string_prepend (&decl, SCOPE_STRING (work)); - if (isdigit ((unsigned char)**mangled)) - { - n = consume_count (mangled); - if (n == -1 - || (int) strlen (*mangled) < n) - { - success = 0; - break; - } - string_prependn (&decl, *mangled, n); - *mangled += n; - } - else if (**mangled == 'X' || **mangled == 'Y') - { - string temp; - do_type (work, mangled, &temp); - string_prepends (&decl, &temp); - } - else if (**mangled == 't') - { - string temp; - string_init (&temp); - success = demangle_template (work, mangled, &temp, - NULL, 1, 1); - if (success) - { - string_prependn (&decl, temp.b, temp.p - temp.b); - string_clear (&temp); - } - else - break; - } - else - { - success = 0; - break; - } - - string_prepend (&decl, "("); - if (member) - { - switch (**mangled) - { - case 'C': - case 'V': - case 'u': - type_quals |= code_for_qualifier (**mangled); - (*mangled)++; - break; - - default: - break; - } - - if (*(*mangled)++ != 'F') - { - success = 0; - break; - } - } - if ((member && !demangle_nested_args (work, mangled, &decl)) - || **mangled != '_') - { - success = 0; - break; - } - (*mangled)++; - if (! PRINT_ANSI_QUALIFIERS) - { - break; - } - if (type_quals != TYPE_UNQUALIFIED) - { - APPEND_BLANK (&decl); - string_append (&decl, qualifier_string (type_quals)); - } - break; - } - case 'G': - (*mangled)++; - break; - - case 'C': - case 'V': - case 'u': - if (PRINT_ANSI_QUALIFIERS) - { - if (!STRING_EMPTY (&decl)) - string_prepend (&decl, " "); - - string_prepend (&decl, demangle_qualifier (**mangled)); - } - (*mangled)++; - break; - /* - } - */ - - /* fall through */ - default: - done = 1; - break; - } - } - - if (success) switch (**mangled) - { - /* A qualified name, such as "Outer::Inner". */ - case 'Q': - case 'K': - { - success = demangle_qualified (work, mangled, result, 0, 1); - break; - } - - /* A back reference to a previously seen squangled type */ - case 'B': - (*mangled)++; - if (!get_count (mangled, &n) || n >= work -> numb) - success = 0; - else - string_append (result, work->btypevec[n]); - break; - - case 'X': - case 'Y': - /* A template parm. We substitute the corresponding argument. */ - { - int idx; - - (*mangled)++; - idx = consume_count_with_underscores (mangled); - - if (idx == -1 - || (work->tmpl_argvec && idx >= work->ntmpl_args) - || consume_count_with_underscores (mangled) == -1) - { - success = 0; - break; - } - - if (work->tmpl_argvec) - string_append (result, work->tmpl_argvec[idx]); - else - { - char buf[10]; - sprintf(buf, "T%d", idx); - string_append (result, buf); - } - - success = 1; - } - break; - - default: - success = demangle_fund_type (work, mangled, result); - if (tk == tk_none) - tk = (type_kind_t) success; - break; - } - - if (success) - { - if (!STRING_EMPTY (&decl)) - { - string_append (result, " "); - string_appends (result, &decl); - } - } - else - string_delete (result); - string_delete (&decl); - - if (success) - /* Assume an integral type, if we're not sure. */ - return (int) ((tk == tk_none) ? tk_integral : tk); - else - return 0; -} - -/* Given a pointer to a type string that represents a fundamental type - argument (int, long, unsigned int, etc) in TYPE, a pointer to the - string in which the demangled output is being built in RESULT, and - the WORK structure, decode the types and add them to the result. - - For example: - - "Ci" => "const int" - "Sl" => "signed long" - "CUs" => "const unsigned short" - - The value returned is really a type_kind_t. */ - -static int -demangle_fund_type (work, mangled, result) - struct work_stuff *work; - const char **mangled; - string *result; -{ - int done = 0; - int success = 1; - char buf[10]; - int dec = 0; - string btype; - type_kind_t tk = tk_integral; - - string_init (&btype); - - /* First pick off any type qualifiers. There can be more than one. */ - - while (!done) - { - switch (**mangled) - { - case 'C': - case 'V': - case 'u': - if (PRINT_ANSI_QUALIFIERS) - { - if (!STRING_EMPTY (result)) - string_prepend (result, " "); - string_prepend (result, demangle_qualifier (**mangled)); - } - (*mangled)++; - break; - case 'U': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "unsigned"); - break; - case 'S': /* signed char only */ - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "signed"); - break; - case 'J': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "__complex"); - break; - default: - done = 1; - break; - } - } - - /* Now pick off the fundamental type. There can be only one. */ - - switch (**mangled) - { - case '\0': - case '_': - break; - case 'v': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "void"); - break; - case 'x': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "long long"); - break; - case 'l': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "long"); - break; - case 'i': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "int"); - break; - case 's': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "short"); - break; - case 'b': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "bool"); - tk = tk_bool; - break; - case 'c': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "char"); - tk = tk_char; - break; - case 'w': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "wchar_t"); - tk = tk_char; - break; - case 'r': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "long double"); - tk = tk_real; - break; - case 'd': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "double"); - tk = tk_real; - break; - case 'f': - (*mangled)++; - APPEND_BLANK (result); - string_append (result, "float"); - tk = tk_real; - break; - case 'G': - (*mangled)++; - if (!isdigit ((unsigned char)**mangled)) - { - success = 0; - break; - } - case 'I': - (*mangled)++; - if (**mangled == '_') - { - int i; - (*mangled)++; - for (i = 0; - i < sizeof (buf) - 1 && **mangled && **mangled != '_'; - (*mangled)++, i++) - buf[i] = **mangled; - if (**mangled != '_') - { - success = 0; - break; - } - buf[i] = '\0'; - (*mangled)++; - } - else - { - strncpy (buf, *mangled, 2); - buf[2] = '\0'; - *mangled += min (strlen (*mangled), 2); - } - sscanf (buf, "%x", &dec); - sprintf (buf, "int%i_t", dec); - APPEND_BLANK (result); - string_append (result, buf); - break; - - /* fall through */ - /* An explicit type, such as "6mytype" or "7integer" */ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - { - int bindex = register_Btype (work); - string btype; - string_init (&btype); - if (demangle_class_name (work, mangled, &btype)) { - remember_Btype (work, btype.b, LEN_STRING (&btype), bindex); - APPEND_BLANK (result); - string_appends (result, &btype); - } - else - success = 0; - string_delete (&btype); - break; - } - case 't': - { - success = demangle_template (work, mangled, &btype, 0, 1, 1); - string_appends (result, &btype); - break; - } - default: - success = 0; - break; - } - - return success ? ((int) tk) : 0; -} - - -/* Handle a template's value parameter for HP aCC (extension from ARM) - **mangled points to 'S' or 'U' */ - -static int -do_hpacc_template_const_value (work, mangled, result) - struct work_stuff *work; - const char **mangled; - string *result; -{ - int unsigned_const; - - if (**mangled != 'U' && **mangled != 'S') - return 0; - - unsigned_const = (**mangled == 'U'); - - (*mangled)++; - - switch (**mangled) - { - case 'N': - string_append (result, "-"); - /* fall through */ - case 'P': - (*mangled)++; - break; - case 'M': - /* special case for -2^31 */ - string_append (result, "-2147483648"); - (*mangled)++; - return 1; - default: - return 0; - } - - /* We have to be looking at an integer now */ - if (!(isdigit ((unsigned char)**mangled))) - return 0; - - /* We only deal with integral values for template - parameters -- so it's OK to look only for digits */ - while (isdigit ((unsigned char)**mangled)) - { - char_str[0] = **mangled; - string_append (result, char_str); - (*mangled)++; - } - - if (unsigned_const) - string_append (result, "U"); - - /* FIXME? Some day we may have 64-bit (or larger :-) ) constants - with L or LL suffixes. pai/1997-09-03 */ - - return 1; /* success */ -} - -/* Handle a template's literal parameter for HP aCC (extension from ARM) - **mangled is pointing to the 'A' */ - -static int -do_hpacc_template_literal (work, mangled, result) - struct work_stuff *work; - const char **mangled; - string *result; -{ - int literal_len = 0; - char * recurse; - char * recurse_dem; - - if (**mangled != 'A') - return 0; - - (*mangled)++; - - literal_len = consume_count (mangled); - - if (literal_len <= 0) - return 0; - - /* Literal parameters are names of arrays, functions, etc. and the - canonical representation uses the address operator */ - string_append (result, "&"); - - /* Now recursively demangle the literal name */ - recurse = (char *) xmalloc (literal_len + 1); - memcpy (recurse, *mangled, literal_len); - recurse[literal_len] = '\000'; - - recurse_dem = cplus_demangle (recurse, work->options); - - if (recurse_dem) - { - string_append (result, recurse_dem); - free (recurse_dem); - } - else - { - string_appendn (result, *mangled, literal_len); - } - (*mangled) += literal_len; - free (recurse); - - return 1; -} - -static int -snarf_numeric_literal (args, arg) - const char ** args; - string * arg; -{ - if (**args == '-') - { - char_str[0] = '-'; - string_append (arg, char_str); - (*args)++; - } - else if (**args == '+') - (*args)++; - - if (!isdigit ((unsigned char)**args)) - return 0; - - while (isdigit ((unsigned char)**args)) - { - char_str[0] = **args; - string_append (arg, char_str); - (*args)++; - } - - return 1; -} - -/* Demangle the next argument, given by MANGLED into RESULT, which - *should be an uninitialized* string. It will be initialized here, - and free'd should anything go wrong. */ - -static int -do_arg (work, mangled, result) - struct work_stuff *work; - const char **mangled; - string *result; -{ - /* Remember where we started so that we can record the type, for - non-squangling type remembering. */ - const char *start = *mangled; - - string_init (result); - - if (work->nrepeats > 0) - { - --work->nrepeats; - - if (work->previous_argument == 0) - return 0; - - /* We want to reissue the previous type in this argument list. */ - string_appends (result, work->previous_argument); - return 1; - } - - if (**mangled == 'n') - { - /* A squangling-style repeat. */ - (*mangled)++; - work->nrepeats = consume_count(mangled); - - if (work->nrepeats <= 0) - /* This was not a repeat count after all. */ - return 0; - - if (work->nrepeats > 9) - { - if (**mangled != '_') - /* The repeat count should be followed by an '_' in this - case. */ - return 0; - else - (*mangled)++; - } - - /* Now, the repeat is all set up. */ - return do_arg (work, mangled, result); - } - - /* Save the result in WORK->previous_argument so that we can find it - if it's repeated. Note that saving START is not good enough: we - do not want to add additional types to the back-referenceable - type vector when processing a repeated type. */ - if (work->previous_argument) - string_clear (work->previous_argument); - else - { - work->previous_argument = (string*) xmalloc (sizeof (string)); - string_init (work->previous_argument); - } - - if (!do_type (work, mangled, work->previous_argument)) - return 0; - - string_appends (result, work->previous_argument); - - remember_type (work, start, *mangled - start); - return 1; -} - -static void -remember_type (work, start, len) - struct work_stuff *work; - const char *start; - int len; -{ - char *tem; - - if (work->forgetting_types) - return; - - if (work -> ntypes >= work -> typevec_size) - { - if (work -> typevec_size == 0) - { - work -> typevec_size = 3; - work -> typevec - = (char **) xmalloc (sizeof (char *) * work -> typevec_size); - } - else - { - work -> typevec_size *= 2; - work -> typevec - = (char **) xrealloc ((char *)work -> typevec, - sizeof (char *) * work -> typevec_size); - } - } - tem = xmalloc (len + 1); - memcpy (tem, start, len); - tem[len] = '\0'; - work -> typevec[work -> ntypes++] = tem; -} - - -/* Remember a K type class qualifier. */ -static void -remember_Ktype (work, start, len) - struct work_stuff *work; - const char *start; - int len; -{ - char *tem; - - if (work -> numk >= work -> ksize) - { - if (work -> ksize == 0) - { - work -> ksize = 5; - work -> ktypevec - = (char **) xmalloc (sizeof (char *) * work -> ksize); - } - else - { - work -> ksize *= 2; - work -> ktypevec - = (char **) xrealloc ((char *)work -> ktypevec, - sizeof (char *) * work -> ksize); - } - } - tem = xmalloc (len + 1); - memcpy (tem, start, len); - tem[len] = '\0'; - work -> ktypevec[work -> numk++] = tem; -} - -/* Register a B code, and get an index for it. B codes are registered - as they are seen, rather than as they are completed, so map<temp<char> > - registers map<temp<char> > as B0, and temp<char> as B1 */ - -static int -register_Btype (work) - struct work_stuff *work; -{ - int ret; - - if (work -> numb >= work -> bsize) - { - if (work -> bsize == 0) - { - work -> bsize = 5; - work -> btypevec - = (char **) xmalloc (sizeof (char *) * work -> bsize); - } - else - { - work -> bsize *= 2; - work -> btypevec - = (char **) xrealloc ((char *)work -> btypevec, - sizeof (char *) * work -> bsize); - } - } - ret = work -> numb++; - work -> btypevec[ret] = NULL; - return(ret); -} - -/* Store a value into a previously registered B code type. */ - -static void -remember_Btype (work, start, len, index) - struct work_stuff *work; - const char *start; - int len, index; -{ - char *tem; - - tem = xmalloc (len + 1); - memcpy (tem, start, len); - tem[len] = '\0'; - work -> btypevec[index] = tem; -} - -/* Lose all the info related to B and K type codes. */ -static void -forget_B_and_K_types (work) - struct work_stuff *work; -{ - int i; - - while (work -> numk > 0) - { - i = --(work -> numk); - if (work -> ktypevec[i] != NULL) - { - free (work -> ktypevec[i]); - work -> ktypevec[i] = NULL; - } - } - - while (work -> numb > 0) - { - i = --(work -> numb); - if (work -> btypevec[i] != NULL) - { - free (work -> btypevec[i]); - work -> btypevec[i] = NULL; - } - } -} -/* Forget the remembered types, but not the type vector itself. */ - -static void -forget_types (work) - struct work_stuff *work; -{ - int i; - - while (work -> ntypes > 0) - { - i = --(work -> ntypes); - if (work -> typevec[i] != NULL) - { - free (work -> typevec[i]); - work -> typevec[i] = NULL; - } - } -} - -/* Process the argument list part of the signature, after any class spec - has been consumed, as well as the first 'F' character (if any). For - example: - - "__als__3fooRT0" => process "RT0" - "complexfunc5__FPFPc_PFl_i" => process "PFPc_PFl_i" - - DECLP must be already initialised, usually non-empty. It won't be freed - on failure. - - Note that g++ differs significantly from ARM and lucid style mangling - with regards to references to previously seen types. For example, given - the source fragment: - - class foo { - public: - foo::foo (int, foo &ia, int, foo &ib, int, foo &ic); - }; - - foo::foo (int, foo &ia, int, foo &ib, int, foo &ic) { ia = ib = ic; } - void foo (int, foo &ia, int, foo &ib, int, foo &ic) { ia = ib = ic; } - - g++ produces the names: - - __3fooiRT0iT2iT2 - foo__FiR3fooiT1iT1 - - while lcc (and presumably other ARM style compilers as well) produces: - - foo__FiR3fooT1T2T1T2 - __ct__3fooFiR3fooT1T2T1T2 - - Note that g++ bases its type numbers starting at zero and counts all - previously seen types, while lucid/ARM bases its type numbers starting - at one and only considers types after it has seen the 'F' character - indicating the start of the function args. For lucid/ARM style, we - account for this difference by discarding any previously seen types when - we see the 'F' character, and subtracting one from the type number - reference. - - */ - -static int -demangle_args (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - string arg; - int need_comma = 0; - int r; - int t; - const char *tem; - char temptype; - - if (PRINT_ARG_TYPES) - { - string_append (declp, "("); - if (**mangled == '\0') - { - string_append (declp, "void"); - } - } - - while ((**mangled != '_' && **mangled != '\0' && **mangled != 'e') - || work->nrepeats > 0) - { - if ((**mangled == 'N') || (**mangled == 'T')) - { - temptype = *(*mangled)++; - - if (temptype == 'N') - { - if (!get_count (mangled, &r)) - { - return (0); - } - } - else - { - r = 1; - } - if ((HP_DEMANGLING || ARM_DEMANGLING || EDG_DEMANGLING) && work -> ntypes >= 10) - { - /* If we have 10 or more types we might have more than a 1 digit - index so we'll have to consume the whole count here. This - will lose if the next thing is a type name preceded by a - count but it's impossible to demangle that case properly - anyway. Eg if we already have 12 types is T12Pc "(..., type1, - Pc, ...)" or "(..., type12, char *, ...)" */ - if ((t = consume_count(mangled)) <= 0) - { - return (0); - } - } - else - { - if (!get_count (mangled, &t)) - { - return (0); - } - } - if (LUCID_DEMANGLING || ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING) - { - t--; - } - /* Validate the type index. Protect against illegal indices from - malformed type strings. */ - if ((t < 0) || (t >= work -> ntypes)) - { - return (0); - } - while (work->nrepeats > 0 || --r >= 0) - { - tem = work -> typevec[t]; - if (need_comma && PRINT_ARG_TYPES) - { - string_append (declp, ", "); - } - if (!do_arg (work, &tem, &arg)) - { - return (0); - } - if (PRINT_ARG_TYPES) - { - string_appends (declp, &arg); - } - string_delete (&arg); - need_comma = 1; - } - } - else - { - if (need_comma && PRINT_ARG_TYPES) - string_append (declp, ", "); - if (!do_arg (work, mangled, &arg)) - return (0); - if (PRINT_ARG_TYPES) - string_appends (declp, &arg); - string_delete (&arg); - need_comma = 1; - } - } - - if (**mangled == 'e') - { - (*mangled)++; - if (PRINT_ARG_TYPES) - { - if (need_comma) - { - string_append (declp, ","); - } - string_append (declp, "..."); - } - } - - if (PRINT_ARG_TYPES) - { - string_append (declp, ")"); - } - return (1); -} - -/* Like demangle_args, but for demangling the argument lists of function - and method pointers or references, not top-level declarations. */ - -static int -demangle_nested_args (work, mangled, declp) - struct work_stuff *work; - const char **mangled; - string *declp; -{ - string* saved_previous_argument; - int result; - int saved_nrepeats; - - /* The G++ name-mangling algorithm does not remember types on nested - argument lists, unless -fsquangling is used, and in that case the - type vector updated by remember_type is not used. So, we turn - off remembering of types here. */ - ++work->forgetting_types; - - /* For the repeat codes used with -fsquangling, we must keep track of - the last argument. */ - saved_previous_argument = work->previous_argument; - saved_nrepeats = work->nrepeats; - work->previous_argument = 0; - work->nrepeats = 0; - - /* Actually demangle the arguments. */ - result = demangle_args (work, mangled, declp); - - /* Restore the previous_argument field. */ - if (work->previous_argument) - string_delete (work->previous_argument); - work->previous_argument = saved_previous_argument; - --work->forgetting_types; - work->nrepeats = saved_nrepeats; - - return result; -} - -static void -demangle_function_name (work, mangled, declp, scan) - struct work_stuff *work; - const char **mangled; - string *declp; - const char *scan; -{ - size_t i; - string type; - const char *tem; - - string_appendn (declp, (*mangled), scan - (*mangled)); - string_need (declp, 1); - *(declp -> p) = '\0'; - - /* Consume the function name, including the "__" separating the name - from the signature. We are guaranteed that SCAN points to the - separator. */ - - (*mangled) = scan + 2; - /* We may be looking at an instantiation of a template function: - foo__Xt1t2_Ft3t4, where t1, t2, ... are template arguments and a - following _F marks the start of the function arguments. Handle - the template arguments first. */ - - if (HP_DEMANGLING && (**mangled == 'X')) - { - demangle_arm_hp_template (work, mangled, 0, declp); - /* This leaves MANGLED pointing to the 'F' marking func args */ - } - - if (LUCID_DEMANGLING || ARM_DEMANGLING || HP_DEMANGLING || EDG_DEMANGLING) - { - - /* See if we have an ARM style constructor or destructor operator. - If so, then just record it, clear the decl, and return. - We can't build the actual constructor/destructor decl until later, - when we recover the class name from the signature. */ - - if (strcmp (declp -> b, "__ct") == 0) - { - work -> constructor += 1; - string_clear (declp); - return; - } - else if (strcmp (declp -> b, "__dt") == 0) - { - work -> destructor += 1; - string_clear (declp); - return; - } - } - - if (declp->p - declp->b >= 3 - && declp->b[0] == 'o' - && declp->b[1] == 'p' - && strchr (cplus_markers, declp->b[2]) != NULL) - { - /* see if it's an assignment expression */ - if (declp->p - declp->b >= 10 /* op$assign_ */ - && memcmp (declp->b + 3, "assign_", 7) == 0) - { - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - int len = declp->p - declp->b - 10; - if ((int) strlen (optable[i].in) == len - && memcmp (optable[i].in, declp->b + 10, len) == 0) - { - string_clear (declp); - string_append (declp, "operator"); - string_append (declp, optable[i].out); - string_append (declp, "="); - break; - } - } - } - else - { - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - int len = declp->p - declp->b - 3; - if ((int) strlen (optable[i].in) == len - && memcmp (optable[i].in, declp->b + 3, len) == 0) - { - string_clear (declp); - string_append (declp, "operator"); - string_append (declp, optable[i].out); - break; - } - } - } - } - else if (declp->p - declp->b >= 5 && memcmp (declp->b, "type", 4) == 0 - && strchr (cplus_markers, declp->b[4]) != NULL) - { - /* type conversion operator */ - tem = declp->b + 5; - if (do_type (work, &tem, &type)) - { - string_clear (declp); - string_append (declp, "operator "); - string_appends (declp, &type); - string_delete (&type); - } - } - else if (declp->b[0] == '_' && declp->b[1] == '_' - && declp->b[2] == 'o' && declp->b[3] == 'p') - { - /* ANSI. */ - /* type conversion operator. */ - tem = declp->b + 4; - if (do_type (work, &tem, &type)) - { - string_clear (declp); - string_append (declp, "operator "); - string_appends (declp, &type); - string_delete (&type); - } - } - else if (declp->b[0] == '_' && declp->b[1] == '_' - && declp->b[2] >= 'a' && declp->b[2] <= 'z' - && declp->b[3] >= 'a' && declp->b[3] <= 'z') - { - if (declp->b[4] == '\0') - { - /* Operator. */ - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - if (strlen (optable[i].in) == 2 - && memcmp (optable[i].in, declp->b + 2, 2) == 0) - { - string_clear (declp); - string_append (declp, "operator"); - string_append (declp, optable[i].out); - break; - } - } - } - else - { - if (declp->b[2] == 'a' && declp->b[5] == '\0') - { - /* Assignment. */ - for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++) - { - if (strlen (optable[i].in) == 3 - && memcmp (optable[i].in, declp->b + 2, 3) == 0) - { - string_clear (declp); - string_append (declp, "operator"); - string_append (declp, optable[i].out); - break; - } - } - } - } - } -} - -/* a mini string-handling package */ - -static void -string_need (s, n) - string *s; - int n; -{ - int tem; - - if (s->b == NULL) - { - if (n < 32) - { - n = 32; - } - s->p = s->b = xmalloc (n); - s->e = s->b + n; - } - else if (s->e - s->p < n) - { - tem = s->p - s->b; - n += tem; - n *= 2; - s->b = xrealloc (s->b, n); - s->p = s->b + tem; - s->e = s->b + n; - } -} - -static void -string_delete (s) - string *s; -{ - if (s->b != NULL) - { - free (s->b); - s->b = s->e = s->p = NULL; - } -} - -static void -string_init (s) - string *s; -{ - s->b = s->p = s->e = NULL; -} - -static void -string_clear (s) - string *s; -{ - s->p = s->b; -} - -#if 0 - -static int -string_empty (s) - string *s; -{ - return (s->b == s->p); -} - -#endif - -static void -string_append (p, s) - string *p; - const char *s; -{ - int n; - if (s == NULL || *s == '\0') - return; - n = strlen (s); - string_need (p, n); - memcpy (p->p, s, n); - p->p += n; -} - -static void -string_appends (p, s) - string *p, *s; -{ - int n; - - if (s->b != s->p) - { - n = s->p - s->b; - string_need (p, n); - memcpy (p->p, s->b, n); - p->p += n; - } -} - -static void -string_appendn (p, s, n) - string *p; - const char *s; - int n; -{ - if (n != 0) - { - string_need (p, n); - memcpy (p->p, s, n); - p->p += n; - } -} - -static void -string_prepend (p, s) - string *p; - const char *s; -{ - if (s != NULL && *s != '\0') - { - string_prependn (p, s, strlen (s)); - } -} - -static void -string_prepends (p, s) - string *p, *s; -{ - if (s->b != s->p) - { - string_prependn (p, s->b, s->p - s->b); - } -} - -static void -string_prependn (p, s, n) - string *p; - const char *s; - int n; -{ - char *q; - - if (n != 0) - { - string_need (p, n); - for (q = p->p - 1; q >= p->b; q--) - { - q[n] = q[0]; - } - memcpy (p->b, s, n); - p->p += n; - } -} - -/* To generate a standalone demangler program for testing purposes, - just compile and link this file with -DMAIN and libiberty.a. When - run, it demangles each command line arg, or each stdin string, and - prints the result on stdout. */ - -#ifdef MAIN - -#include "getopt.h" - -static char *program_name; -static char *program_version = VERSION; -static int flags = DMGL_PARAMS | DMGL_ANSI; - -static void demangle_it PARAMS ((char *)); -static void usage PARAMS ((FILE *, int)); -static void fatal PARAMS ((char *)); - -static void -demangle_it (mangled_name) - char *mangled_name; -{ - char *result; - - result = cplus_demangle (mangled_name, flags); - if (result == NULL) - { - printf ("%s\n", mangled_name); - } - else - { - printf ("%s\n", result); - free (result); - } -} - -static void -usage (stream, status) - FILE *stream; - int status; -{ - fprintf (stream, "\ -Usage: %s [-_] [-n] [-s {gnu,lucid,arm,hp,edg}] [--strip-underscores]\n\ - [--no-strip-underscores] [--format={gnu,lucid,arm,hp,edg}]\n\ - [--help] [--version] [arg...]\n", - program_name); - exit (status); -} - -#define MBUF_SIZE 32767 -char mbuffer[MBUF_SIZE]; - -/* Defined in the automatically-generated underscore.c. */ -extern int prepends_underscore; - -int strip_underscore = 0; - -static struct option long_options[] = { - {"strip-underscores", no_argument, 0, '_'}, - {"format", required_argument, 0, 's'}, - {"help", no_argument, 0, 'h'}, - {"java", no_argument, 0, 'j'}, - {"no-strip-underscores", no_argument, 0, 'n'}, - {"version", no_argument, 0, 'v'}, - {0, no_argument, 0, 0} -}; - -/* More 'friendly' abort that prints the line and file. - config.h can #define abort fancy_abort if you like that sort of thing. */ - -void -fancy_abort () -{ - fatal ("Internal gcc abort."); -} - - -/* Return the string of non-alnum characters that may occur - as a valid symbol component, in the standard assembler symbol - syntax. */ - -static const char * -standard_symbol_characters () -{ - return "_$."; -} - - -/* Return the string of non-alnum characters that may occur - as a valid symbol name component in an HP object file. - - Note that, since HP's compiler generates object code straight from - C++ source, without going through an assembler, its mangled - identifiers can use all sorts of characters that no assembler would - tolerate, so the alphabet this function creates is a little odd. - Here are some sample mangled identifiers offered by HP: - - typeid*__XT24AddressIndExpClassMember_ - [Vftptr]key:__dt__32OrdinaryCompareIndExpClassMemberFv - __ct__Q2_9Elf64_Dyn18{unnamed.union.#1}Fv - - This still seems really weird to me, since nowhere else in this - file is there anything to recognize curly brackets, parens, etc. - I've talked with Srikanth <srikanth@cup.hp.com>, and he assures me - this is right, but I still strongly suspect that there's a - misunderstanding here. - - If we decide it's better for c++filt to use HP's assembler syntax - to scrape identifiers out of its input, here's the definition of - the symbol name syntax from the HP assembler manual: - - Symbols are composed of uppercase and lowercase letters, decimal - digits, dollar symbol, period (.), ampersand (&), pound sign(#) and - underscore (_). A symbol can begin with a letter, digit underscore or - dollar sign. If a symbol begins with a digit, it must contain a - non-digit character. - - So have fun. */ -static const char * -hp_symbol_characters () -{ - return "_$.<>#,*&[]:(){}"; -} - - -int -main (argc, argv) - int argc; - char **argv; -{ - char *result; - int c; - char *valid_symbols; - - program_name = argv[0]; - - strip_underscore = prepends_underscore; - - while ((c = getopt_long (argc, argv, "_ns:j", long_options, (int *) 0)) != EOF) - { - switch (c) - { - case '?': - usage (stderr, 1); - break; - case 'h': - usage (stdout, 0); - case 'n': - strip_underscore = 0; - break; - case 'v': - printf ("GNU %s (C++ demangler), version %s\n", program_name, program_version); - exit (0); - case '_': - strip_underscore = 1; - break; - case 'j': - flags |= DMGL_JAVA; - break; - case 's': - if (strcmp (optarg, "gnu") == 0) - { - current_demangling_style = gnu_demangling; - } - else if (strcmp (optarg, "lucid") == 0) - { - current_demangling_style = lucid_demangling; - } - else if (strcmp (optarg, "arm") == 0) - { - current_demangling_style = arm_demangling; - } - else if (strcmp (optarg, "hp") == 0) - { - current_demangling_style = hp_demangling; - } - else if (strcmp (optarg, "edg") == 0) - { - current_demangling_style = edg_demangling; - } - else - { - fprintf (stderr, "%s: unknown demangling style `%s'\n", - program_name, optarg); - exit (1); - } - break; - } - } - - if (optind < argc) - { - for ( ; optind < argc; optind++) - { - demangle_it (argv[optind]); - } - } - else - { - switch (current_demangling_style) - { - case gnu_demangling: - case lucid_demangling: - case arm_demangling: - case edg_demangling: - valid_symbols = standard_symbol_characters (); - break; - case hp_demangling: - valid_symbols = hp_symbol_characters (); - break; - default: - /* Folks should explicitly indicate the appropriate alphabet for - each demangling. Providing a default would allow the - question to go unconsidered. */ - abort (); - } - - for (;;) - { - int i = 0; - c = getchar (); - /* Try to read a label. */ - while (c != EOF && (isalnum (c) || strchr (valid_symbols, c))) - { - if (i >= MBUF_SIZE-1) - break; - mbuffer[i++] = c; - c = getchar (); - } - if (i > 0) - { - int skip_first = 0; - - if (mbuffer[0] == '.') - ++skip_first; - if (strip_underscore && mbuffer[skip_first] == '_') - ++skip_first; - - if (skip_first > i) - skip_first = i; - - mbuffer[i] = 0; - - result = cplus_demangle (mbuffer + skip_first, flags); - if (result) - { - if (mbuffer[0] == '.') - putc ('.', stdout); - fputs (result, stdout); - free (result); - } - else - fputs (mbuffer, stdout); - - fflush (stdout); - } - if (c == EOF) - break; - putchar (c); - } - } - - exit (0); -} - -static void -fatal (str) - char *str; -{ - fprintf (stderr, "%s: %s\n", program_name, str); - exit (1); -} - -PTR -xmalloc (size) - size_t size; -{ - register PTR value = (PTR) malloc (size); - if (value == 0) - fatal ("virtual memory exhausted"); - return value; -} - -PTR -xrealloc (ptr, size) - PTR ptr; - size_t size; -{ - register PTR value = (PTR) realloc (ptr, size); - if (value == 0) - fatal ("virtual memory exhausted"); - return value; -} -#endif /* main */ diff --git a/gnu/egcs/libiberty/dyn-string.c b/gnu/egcs/libiberty/dyn-string.c deleted file mode 100644 index 69897f84c5e..00000000000 --- a/gnu/egcs/libiberty/dyn-string.c +++ /dev/null @@ -1,409 +0,0 @@ -/* An abstract string datatype. - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - Contributed by Mark Mitchell (mark@markmitchell.com). - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdio.h> - -#ifdef HAVE_STRING_H -#include <string.h> -#endif - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#include "libiberty.h" -#include "dyn-string.h" - -/* If this file is being compiled for inclusion in the C++ runtime - library, as part of the demangler implementation, we don't want to - abort if an allocation fails. Instead, percolate an error code up - through the call chain. */ - -#ifdef IN_LIBGCC2 -#define RETURN_ON_ALLOCATION_FAILURE -#endif - -/* Performs in-place initialization of a dyn_string struct. This - function can be used with a dyn_string struct on the stack or - embedded in another object. The contents of of the string itself - are still dynamically allocated. The string initially is capable - of holding at least SPACE characeters, including the terminating - NUL. If SPACE is 0, it will silently be increated to 1. - - If RETURN_ON_ALLOCATION_FAILURE is defined and memory allocation - fails, returns 0. Otherwise returns 1. */ - -int -dyn_string_init (ds_struct_ptr, space) - struct dyn_string *ds_struct_ptr; - int space; -{ - /* We need at least one byte in which to store the terminating NUL. */ - if (space == 0) - space = 1; - -#ifdef RETURN_ON_ALLOCATION_FAILURE - ds_struct_ptr->s = (char *) malloc (space); - if (ds_struct_ptr->s == NULL) - return 0; -#else - ds_struct_ptr->s = (char *) xmalloc (space); -#endif - ds_struct_ptr->allocated = space; - ds_struct_ptr->length = 0; - ds_struct_ptr->s[0] = '\0'; - - return 1; -} - -/* Create a new dynamic string capable of holding at least SPACE - characters, including the terminating NUL. If SPACE is 0, it will - be silently increased to 1. If RETURN_ON_ALLOCATION_FAILURE is - defined and memory allocation fails, returns NULL. Otherwise - returns the newly allocated string. */ - -dyn_string_t -dyn_string_new (space) - int space; -{ - dyn_string_t result; -#ifdef RETURN_ON_ALLOCATION_FAILURE - result = (dyn_string_t) malloc (sizeof (struct dyn_string)); - if (result == NULL) - return NULL; - if (!dyn_string_init (result, space)) - { - free (result); - return NULL; - } -#else - result = (dyn_string_t) xmalloc (sizeof (struct dyn_string)); - dyn_string_init (result, space); -#endif - return result; -} - -/* Free the memory used by DS. */ - -void -dyn_string_delete (ds) - dyn_string_t ds; -{ - free (ds->s); - free (ds); -} - -/* Returns the contents of DS in a buffer allocated with malloc. It - is the caller's responsibility to deallocate the buffer using free. - DS is then set to the empty string. Deletes DS itself. */ - -char* -dyn_string_release (ds) - dyn_string_t ds; -{ - /* Store the old buffer. */ - char* result = ds->s; - /* The buffer is no longer owned by DS. */ - ds->s = NULL; - /* Delete DS. */ - free (ds); - /* Return the old buffer. */ - return result; -} - -/* Increase the capacity of DS so it can hold at least SPACE - characters, plus the terminating NUL. This function will not (at - present) reduce the capacity of DS. Returns DS on success. - - If RETURN_ON_ALLOCATION_FAILURE is defined and a memory allocation - operation fails, deletes DS and returns NULL. */ - -dyn_string_t -dyn_string_resize (ds, space) - dyn_string_t ds; - int space; -{ - int new_allocated = ds->allocated; - - /* Increase SPACE to hold the NUL termination. */ - ++space; - - /* Increase allocation by factors of two. */ - while (space > new_allocated) - new_allocated *= 2; - - if (new_allocated != ds->allocated) - { - ds->allocated = new_allocated; - /* We actually need more space. */ -#ifdef RETURN_ON_ALLOCATION_FAILURE - ds->s = (char *) realloc (ds->s, ds->allocated); - if (ds->s == NULL) - { - free (ds); - return NULL; - } -#else - ds->s = (char *) xrealloc (ds->s, ds->allocated); -#endif - } - - return ds; -} - -/* Sets the contents of DS to the empty string. */ - -void -dyn_string_clear (ds) - dyn_string_t ds; -{ - /* A dyn_string always has room for at least the NUL terminator. */ - ds->s[0] = '\0'; - ds->length = 0; -} - -/* Makes the contents of DEST the same as the contents of SRC. DEST - and SRC must be distinct. Returns 1 on success. On failure, if - RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ - -int -dyn_string_copy (dest, src) - dyn_string_t dest; - dyn_string_t src; -{ - if (dest == src) - abort (); - - /* Make room in DEST. */ - if (dyn_string_resize (dest, src->length) == NULL) - return 0; - /* Copy DEST into SRC. */ - strcpy (dest->s, src->s); - /* Update the size of DEST. */ - dest->length = src->length; - return 1; -} - -/* Copies SRC, a NUL-terminated string, into DEST. Returns 1 on - success. On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST - and returns 0. */ - -int -dyn_string_copy_cstr (dest, src) - dyn_string_t dest; - const char *src; -{ - int length = strlen (src); - /* Make room in DEST. */ - if (dyn_string_resize (dest, length) == NULL) - return 0; - /* Copy DEST into SRC. */ - strcpy (dest->s, src); - /* Update the size of DEST. */ - dest->length = length; - return 1; -} - -/* Inserts SRC at the beginning of DEST. DEST is expanded as - necessary. SRC and DEST must be distinct. Returns 1 on success. - On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and - returns 0. */ - -int -dyn_string_prepend (dest, src) - dyn_string_t dest; - dyn_string_t src; -{ - return dyn_string_insert (dest, 0, src); -} - -/* Inserts SRC, a NUL-terminated string, at the beginning of DEST. - DEST is expanded as necessary. Returns 1 on success. On failure, - if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ - -int -dyn_string_prepend_cstr (dest, src) - dyn_string_t dest; - const char *src; -{ - return dyn_string_insert_cstr (dest, 0, src); -} - -/* Inserts SRC into DEST starting at position POS. DEST is expanded - as necessary. SRC and DEST must be distinct. Returns 1 on - success. On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST - and returns 0. */ - -int -dyn_string_insert (dest, pos, src) - dyn_string_t dest; - int pos; - dyn_string_t src; -{ - int i; - - if (src == dest) - abort (); - - if (dyn_string_resize (dest, dest->length + src->length) == NULL) - return 0; - /* Make room for the insertion. Be sure to copy the NUL. */ - for (i = dest->length; i >= pos; --i) - dest->s[i + src->length] = dest->s[i]; - /* Splice in the new stuff. */ - strncpy (dest->s + pos, src->s, src->length); - /* Compute the new length. */ - dest->length += src->length; - return 1; -} - -/* Inserts SRC, a NUL-terminated string, into DEST starting at - position POS. DEST is expanded as necessary. Returns 1 on - success. On failure, RETURN_ON_ALLOCATION_FAILURE, deletes DEST - and returns 0. */ - -int -dyn_string_insert_cstr (dest, pos, src) - dyn_string_t dest; - int pos; - const char *src; -{ - int i; - int length = strlen (src); - - if (dyn_string_resize (dest, dest->length + length) == NULL) - return 0; - /* Make room for the insertion. Be sure to copy the NUL. */ - for (i = dest->length; i >= pos; --i) - dest->s[i + length] = dest->s[i]; - /* Splice in the new stuff. */ - strncpy (dest->s + pos, src, length); - /* Compute the new length. */ - dest->length += length; - return 1; -} - -/* Append S to DS, resizing DS if necessary. Returns 1 on success. - On failure, if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and - returns 0. */ - -int -dyn_string_append (dest, s) - dyn_string_t dest; - dyn_string_t s; -{ - if (dyn_string_resize (dest, dest->length + s->length) == 0) - return 0; - strcpy (dest->s + dest->length, s->s); - dest->length += s->length; - return 1; -} - -/* Append the NUL-terminated string S to DS, resizing DS if necessary. - Returns 1 on success. On failure, if RETURN_ON_ALLOCATION_FAILURE, - deletes DEST and returns 0. */ - -int -dyn_string_append_cstr (dest, s) - dyn_string_t dest; - const char *s; -{ - int len = strlen (s); - - /* The new length is the old length plus the size of our string, plus - one for the null at the end. */ - if (dyn_string_resize (dest, dest->length + len) == NULL) - return 0; - strcpy (dest->s + dest->length, s); - dest->length += len; - return 1; -} - -/* Appends C to the end of DEST. Returns 1 on success. On failiure, - if RETURN_ON_ALLOCATION_FAILURE, deletes DEST and returns 0. */ - -int -dyn_string_append_char (dest, c) - dyn_string_t dest; - int c; -{ - /* Make room for the extra character. */ - if (dyn_string_resize (dest, dest->length + 1) == NULL) - return 0; - /* Append the character; it will overwrite the old NUL. */ - dest->s[dest->length] = c; - /* Add a new NUL at the end. */ - dest->s[dest->length + 1] = '\0'; - /* Update the length. */ - ++(dest->length); - return 1; -} - -/* Sets the contents of DEST to the substring of SRC starting at START - and ending before END. START must be less than or equal to END, - and both must be between zero and the length of SRC, inclusive. - Returns 1 on success. On failure, if RETURN_ON_ALLOCATION_FAILURE, - deletes DEST and returns 0. */ - -int -dyn_string_substring (dest, src, start, end) - dyn_string_t dest; - dyn_string_t src; - int start; - int end; -{ - int i; - int length = end - start; - - if (start > end || start > src->length || end > src->length) - abort (); - - /* Make room for the substring. */ - if (dyn_string_resize (dest, length) == NULL) - return 0; - /* Copy the characters in the substring, */ - for (i = length; --i >= 0; ) - dest->s[i] = src->s[start + i]; - /* NUL-terimate the result. */ - dest->s[length] = '\0'; - /* Record the length of the substring. */ - dest->length = length; - - return 1; -} - -/* Returns non-zero if DS1 and DS2 have the same contents. */ - -int -dyn_string_eq (ds1, ds2) - dyn_string_t ds1; - dyn_string_t ds2; -{ - /* If DS1 and DS2 have different lengths, they must not be the same. */ - if (ds1->length != ds2->length) - return 0; - else - return !strcmp (ds1->s, ds2->s); -} diff --git a/gnu/egcs/libiberty/fdmatch.c b/gnu/egcs/libiberty/fdmatch.c deleted file mode 100644 index 7af039f5a2b..00000000000 --- a/gnu/egcs/libiberty/fdmatch.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Compare two open file descriptors to see if they refer to the same file. - Copyright (C) 1991 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - - -/* - -NAME - - fdmatch -- see if two file descriptors refer to same file - -SYNOPSIS - - int fdmatch (int fd1, int fd2) - -DESCRIPTION - - Check to see if two open file descriptors refer to the same file. - This is useful, for example, when we have an open file descriptor - for an unnamed file, and the name of a file that we believe to - correspond to that fd. This can happen when we are exec'd with - an already open file (stdout for example) or from the SVR4 /proc - calls that return open file descriptors for mapped address spaces. - All we have to do is open the file by name and check the two file - descriptors for a match, which is done by comparing major&minor - device numbers and inode numbers. - -BUGS - - (FIXME: does this work for networks?) - It works for NFS, which assigns a device number to each mount. - -*/ - -#include "ansidecl.h" -#include "libiberty.h" -#include <sys/types.h> -#include <sys/stat.h> - -int fdmatch (fd1, fd2) - int fd1; - int fd2; -{ - struct stat sbuf1; - struct stat sbuf2; - - if ((fstat (fd1, &sbuf1) == 0) && - (fstat (fd2, &sbuf2) == 0) && - (sbuf1.st_dev == sbuf2.st_dev) && - (sbuf1.st_ino == sbuf2.st_ino)) - { - return (1); - } - else - { - return (0); - } -} diff --git a/gnu/egcs/libiberty/floatformat.c b/gnu/egcs/libiberty/floatformat.c deleted file mode 100644 index 1d8f16df353..00000000000 --- a/gnu/egcs/libiberty/floatformat.c +++ /dev/null @@ -1,403 +0,0 @@ -/* IEEE floating point support routines, for GDB, the GNU Debugger. - Copyright (C) 1991, 1994, 1999 Free Software Foundation, Inc. - -This file is part of GDB. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include "floatformat.h" -#include <math.h> /* ldexp */ -#ifdef __STDC__ -#include <stddef.h> -extern void *memcpy (void *s1, const void *s2, size_t n); -extern void *memset (void *s, int c, size_t n); -#else -extern char *memcpy (); -extern char *memset (); -#endif - -/* The odds that CHAR_BIT will be anything but 8 are low enough that I'm not - going to bother with trying to muck around with whether it is defined in - a system header, what we do if not, etc. */ -#define FLOATFORMAT_CHAR_BIT 8 - -/* floatformats for IEEE single and double, big and little endian. */ -const struct floatformat floatformat_ieee_single_big = -{ - floatformat_big, 32, 0, 1, 8, 127, 255, 9, 23, floatformat_intbit_no -}; -const struct floatformat floatformat_ieee_single_little = -{ - floatformat_little, 32, 0, 1, 8, 127, 255, 9, 23, floatformat_intbit_no -}; -const struct floatformat floatformat_ieee_double_big = -{ - floatformat_big, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no -}; -const struct floatformat floatformat_ieee_double_little = -{ - floatformat_little, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no -}; - -/* floatformat for IEEE double, little endian byte order, with big endian word - ordering, as on the ARM. */ - -const struct floatformat floatformat_ieee_double_littlebyte_bigword = -{ - floatformat_littlebyte_bigword, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no -}; - -const struct floatformat floatformat_i387_ext = -{ - floatformat_little, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64, - floatformat_intbit_yes -}; -const struct floatformat floatformat_m68881_ext = -{ - /* Note that the bits from 16 to 31 are unused. */ - floatformat_big, 96, 0, 1, 15, 0x3fff, 0x7fff, 32, 64, floatformat_intbit_yes -}; -const struct floatformat floatformat_i960_ext = -{ - /* Note that the bits from 0 to 15 are unused. */ - floatformat_little, 96, 16, 17, 15, 0x3fff, 0x7fff, 32, 64, - floatformat_intbit_yes -}; -const struct floatformat floatformat_m88110_ext = -{ -#ifdef HARRIS_FLOAT_FORMAT - /* Harris uses raw format 128 bytes long, but the number is just an ieee - double, and the last 64 bits are wasted. */ - floatformat_big,128, 0, 1, 11, 0x3ff, 0x7ff, 12, 52, - floatformat_intbit_no -#else - floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64, - floatformat_intbit_yes -#endif /* HARRIS_FLOAT_FORMAT */ -}; -const struct floatformat floatformat_arm_ext = -{ - /* Bits 1 to 16 are unused. */ - floatformat_big, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64, - floatformat_intbit_yes -}; - -static unsigned long get_field PARAMS ((unsigned char *, - enum floatformat_byteorders, - unsigned int, - unsigned int, - unsigned int)); - -/* Extract a field which starts at START and is LEN bytes long. DATA and - TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */ -static unsigned long -get_field (data, order, total_len, start, len) - unsigned char *data; - enum floatformat_byteorders order; - unsigned int total_len; - unsigned int start; - unsigned int len; -{ - unsigned long result; - unsigned int cur_byte; - int cur_bitshift; - - /* Start at the least significant part of the field. */ - cur_byte = (start + len) / FLOATFORMAT_CHAR_BIT; - if (order == floatformat_little) - cur_byte = (total_len / FLOATFORMAT_CHAR_BIT) - cur_byte - 1; - cur_bitshift = - ((start + len) % FLOATFORMAT_CHAR_BIT) - FLOATFORMAT_CHAR_BIT; - result = *(data + cur_byte) >> (-cur_bitshift); - cur_bitshift += FLOATFORMAT_CHAR_BIT; - if (order == floatformat_little) - ++cur_byte; - else - --cur_byte; - - /* Move towards the most significant part of the field. */ - while ((unsigned int) cur_bitshift < len) - { - if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT) - /* This is the last byte; zero out the bits which are not part of - this field. */ - result |= - (*(data + cur_byte) & ((1 << (len - cur_bitshift)) - 1)) - << cur_bitshift; - else - result |= *(data + cur_byte) << cur_bitshift; - cur_bitshift += FLOATFORMAT_CHAR_BIT; - if (order == floatformat_little) - ++cur_byte; - else - --cur_byte; - } - return result; -} - -#ifndef min -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - -/* Convert from FMT to a double. - FROM is the address of the extended float. - Store the double in *TO. */ - -void -floatformat_to_double (fmt, from, to) - const struct floatformat *fmt; - char *from; - double *to; -{ - unsigned char *ufrom = (unsigned char *)from; - double dto; - long exponent; - unsigned long mant; - unsigned int mant_bits, mant_off; - int mant_bits_left; - int special_exponent; /* It's a NaN, denorm or zero */ - - exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize, - fmt->exp_start, fmt->exp_len); - /* Note that if exponent indicates a NaN, we can't really do anything useful - (not knowing if the host has NaN's, or how to build one). So it will - end up as an infinity or something close; that is OK. */ - - mant_bits_left = fmt->man_len; - mant_off = fmt->man_start; - dto = 0.0; - - special_exponent = exponent == 0 || (unsigned long) exponent == fmt->exp_nan; - - /* Don't bias zero's, denorms or NaNs. */ - if (!special_exponent) - exponent -= fmt->exp_bias; - - /* Build the result algebraically. Might go infinite, underflow, etc; - who cares. */ - - /* If this format uses a hidden bit, explicitly add it in now. Otherwise, - increment the exponent by one to account for the integer bit. */ - - if (!special_exponent) - { - if (fmt->intbit == floatformat_intbit_no) - dto = ldexp (1.0, exponent); - else - exponent++; - } - - while (mant_bits_left > 0) - { - mant_bits = min (mant_bits_left, 32); - - mant = get_field (ufrom, fmt->byteorder, fmt->totalsize, - mant_off, mant_bits); - - dto += ldexp ((double)mant, exponent - mant_bits); - exponent -= mant_bits; - mant_off += mant_bits; - mant_bits_left -= mant_bits; - } - - /* Negate it if negative. */ - if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1)) - dto = -dto; - *to = dto; -} - -static void put_field PARAMS ((unsigned char *, enum floatformat_byteorders, - unsigned int, - unsigned int, - unsigned int, - unsigned long)); - -/* Set a field which starts at START and is LEN bytes long. DATA and - TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */ -static void -put_field (data, order, total_len, start, len, stuff_to_put) - unsigned char *data; - enum floatformat_byteorders order; - unsigned int total_len; - unsigned int start; - unsigned int len; - unsigned long stuff_to_put; -{ - unsigned int cur_byte; - int cur_bitshift; - - /* Start at the least significant part of the field. */ - cur_byte = (start + len) / FLOATFORMAT_CHAR_BIT; - if (order == floatformat_little) - cur_byte = (total_len / FLOATFORMAT_CHAR_BIT) - cur_byte - 1; - cur_bitshift = - ((start + len) % FLOATFORMAT_CHAR_BIT) - FLOATFORMAT_CHAR_BIT; - *(data + cur_byte) &= - ~(((1 << ((start + len) % FLOATFORMAT_CHAR_BIT)) - 1) << (-cur_bitshift)); - *(data + cur_byte) |= - (stuff_to_put & ((1 << FLOATFORMAT_CHAR_BIT) - 1)) << (-cur_bitshift); - cur_bitshift += FLOATFORMAT_CHAR_BIT; - if (order == floatformat_little) - ++cur_byte; - else - --cur_byte; - - /* Move towards the most significant part of the field. */ - while ((unsigned int) cur_bitshift < len) - { - if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT) - { - /* This is the last byte. */ - *(data + cur_byte) &= - ~((1 << (len - cur_bitshift)) - 1); - *(data + cur_byte) |= (stuff_to_put >> cur_bitshift); - } - else - *(data + cur_byte) = ((stuff_to_put >> cur_bitshift) - & ((1 << FLOATFORMAT_CHAR_BIT) - 1)); - cur_bitshift += FLOATFORMAT_CHAR_BIT; - if (order == floatformat_little) - ++cur_byte; - else - --cur_byte; - } -} - -/* The converse: convert the double *FROM to an extended float - and store where TO points. Neither FROM nor TO have any alignment - restrictions. */ - -void -floatformat_from_double (fmt, from, to) - const struct floatformat *fmt; - double *from; - char *to; -{ - double dfrom; - int exponent; - double mant; - unsigned int mant_bits, mant_off; - int mant_bits_left; - unsigned char *uto = (unsigned char *)to; - - memcpy (&dfrom, from, sizeof (dfrom)); - memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT); - if (dfrom == 0) - return; /* Result is zero */ - if (dfrom != dfrom) - { - /* From is NaN */ - put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start, - fmt->exp_len, fmt->exp_nan); - /* Be sure it's not infinity, but NaN value is irrel */ - put_field (uto, fmt->byteorder, fmt->totalsize, fmt->man_start, - 32, 1); - return; - } - - /* If negative, set the sign bit. */ - if (dfrom < 0) - { - put_field (uto, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1, 1); - dfrom = -dfrom; - } - - /* How to tell an infinity from an ordinary number? FIXME-someday */ - - mant = frexp (dfrom, &exponent); - put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start, fmt->exp_len, - exponent + fmt->exp_bias - 1); - - mant_bits_left = fmt->man_len; - mant_off = fmt->man_start; - while (mant_bits_left > 0) - { - unsigned long mant_long; - mant_bits = mant_bits_left < 32 ? mant_bits_left : 32; - - mant *= 4294967296.0; - mant_long = (unsigned long)mant; - mant -= mant_long; - - /* If the integer bit is implicit, then we need to discard it. - If we are discarding a zero, we should be (but are not) creating - a denormalized number which means adjusting the exponent - (I think). */ - if ((unsigned int) mant_bits_left == fmt->man_len - && fmt->intbit == floatformat_intbit_no) - { - mant_long &= 0x7fffffff; - mant_bits -= 1; - } - else if (mant_bits < 32) - { - /* The bits we want are in the most significant MANT_BITS bits of - mant_long. Move them to the least significant. */ - mant_long >>= 32 - mant_bits; - } - - put_field (uto, fmt->byteorder, fmt->totalsize, - mant_off, mant_bits, mant_long); - mant_off += mant_bits; - mant_bits_left -= mant_bits; - } -} - - -#ifdef IEEE_DEBUG - -/* This is to be run on a host which uses IEEE floating point. */ - -void -ieee_test (n) - double n; -{ - double result; - char exten[16]; - - floatformat_to_double (&floatformat_ieee_double_big, &n, &result); - if (n != result) - printf ("Differ(to): %.20g -> %.20g\n", n, result); - floatformat_from_double (&floatformat_ieee_double_big, &n, &result); - if (n != result) - printf ("Differ(from): %.20g -> %.20g\n", n, result); - - floatformat_from_double (&floatformat_m68881_ext, &n, exten); - floatformat_to_double (&floatformat_m68881_ext, exten, &result); - if (n != result) - printf ("Differ(to+from): %.20g -> %.20g\n", n, result); - -#if IEEE_DEBUG > 1 - /* This is to be run on a host which uses 68881 format. */ - { - long double ex = *(long double *)exten; - if (ex != n) - printf ("Differ(from vs. extended): %.20g\n", n); - } -#endif -} - -int -main () -{ - ieee_test (0.5); - ieee_test (256.0); - ieee_test (0.12345); - ieee_test (234235.78907234); - ieee_test (-512.0); - ieee_test (-0.004321); - return 0; -} -#endif diff --git a/gnu/egcs/libiberty/fnmatch.c b/gnu/egcs/libiberty/fnmatch.c deleted file mode 100644 index 0a9bfe6152b..00000000000 --- a/gnu/egcs/libiberty/fnmatch.c +++ /dev/null @@ -1,225 +0,0 @@ -/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. - -NOTE: The canonical source of this file is maintained with the GNU C Library. -Bugs can be reported to bug-glibc@prep.ai.mit.edu. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use <config.h> instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ -#include <config.h> -#else -#include "config.h" -#endif -#endif - - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -/* This code to undef const added in libiberty. */ -#ifndef __STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include <errno.h> -#include <fnmatch.h> -#include <ctype.h> - - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) - - -#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS) -extern int errno; -#endif - -/* Match STRING against the filename pattern PATTERN, returning zero if - it matches, nonzero if not. */ -int -fnmatch (pattern, string, flags) - const char *pattern; - const char *string; - int flags; -{ - register const char *p = pattern, *n = string; - register unsigned char c; - -/* Note that this evalutes C many times. */ -#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c)) - - while ((c = *p++) != '\0') - { - c = FOLD (c); - - switch (c) - { - case '?': - if (*n == '\0') - return FNM_NOMATCH; - else if ((flags & FNM_FILE_NAME) && *n == '/') - return FNM_NOMATCH; - else if ((flags & FNM_PERIOD) && *n == '.' && - (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) - return FNM_NOMATCH; - break; - - case '\\': - if (!(flags & FNM_NOESCAPE)) - { - c = *p++; - c = FOLD (c); - } - if (FOLD ((unsigned char)*n) != c) - return FNM_NOMATCH; - break; - - case '*': - if ((flags & FNM_PERIOD) && *n == '.' && - (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) - return FNM_NOMATCH; - - for (c = *p++; c == '?' || c == '*'; c = *p++, ++n) - if (((flags & FNM_FILE_NAME) && *n == '/') || - (c == '?' && *n == '\0')) - return FNM_NOMATCH; - - if (c == '\0') - return 0; - - { - unsigned char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; - c1 = FOLD (c1); - for (--p; *n != '\0'; ++n) - if ((c == '[' || FOLD ((unsigned char)*n) == c1) && - fnmatch (p, n, flags & ~FNM_PERIOD) == 0) - return 0; - return FNM_NOMATCH; - } - - case '[': - { - /* Nonzero if the sense of the character class is inverted. */ - register int not; - - if (*n == '\0') - return FNM_NOMATCH; - - if ((flags & FNM_PERIOD) && *n == '.' && - (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) - return FNM_NOMATCH; - - not = (*p == '!' || *p == '^'); - if (not) - ++p; - - c = *p++; - for (;;) - { - register unsigned char cstart = c, cend = c; - - if (!(flags & FNM_NOESCAPE) && c == '\\') - cstart = cend = *p++; - - cstart = cend = FOLD (cstart); - - if (c == '\0') - /* [ (unterminated) loses. */ - return FNM_NOMATCH; - - c = *p++; - c = FOLD (c); - - if ((flags & FNM_FILE_NAME) && c == '/') - /* [/] can never match. */ - return FNM_NOMATCH; - - if (c == '-' && *p != ']') - { - cend = *p++; - if (!(flags & FNM_NOESCAPE) && cend == '\\') - cend = *p++; - if (cend == '\0') - return FNM_NOMATCH; - cend = FOLD (cend); - - c = *p++; - } - - if (FOLD ((unsigned char)*n) >= cstart - && FOLD ((unsigned char)*n) <= cend) - goto matched; - - if (c == ']') - break; - } - if (!not) - return FNM_NOMATCH; - break; - - matched:; - /* Skip the rest of the [...] that already matched. */ - while (c != ']') - { - if (c == '\0') - /* [... (unterminated) loses. */ - return FNM_NOMATCH; - - c = *p++; - if (!(flags & FNM_NOESCAPE) && c == '\\') - /* XXX 1003.2d11 is unclear if this is right. */ - ++p; - } - if (not) - return FNM_NOMATCH; - } - break; - - default: - if (c != FOLD ((unsigned char)*n)) - return FNM_NOMATCH; - } - - ++n; - } - - if (*n == '\0') - return 0; - - if ((flags & FNM_LEADING_DIR) && *n == '/') - /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ - return 0; - - return FNM_NOMATCH; -} - -#endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/gnu/egcs/libiberty/getcwd.c b/gnu/egcs/libiberty/getcwd.c deleted file mode 100644 index 47b1c1eec31..00000000000 --- a/gnu/egcs/libiberty/getcwd.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Emulate getcwd using getwd. - This function is in the public domain. */ - -/* -NAME - getcwd -- get absolute pathname for current working directory - -SYNOPSIS - char *getcwd (char pathname[len], len) - -DESCRIPTION - Copy the absolute pathname for the current working directory into - the supplied buffer and return a pointer to the buffer. If the - current directory's path doesn't fit in LEN characters, the result - is NULL and errno is set. - - If pathname is a null pointer, getcwd() will obtain size bytes of - space using malloc. - -BUGS - Emulated via the getwd() call, which is reasonable for most - systems that do not have getcwd(). - -*/ - -#include "config.h" - -#ifdef HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif -#include <errno.h> - -extern char *getwd (); -extern int errno; - -#ifndef MAXPATHLEN -#define MAXPATHLEN 1024 -#endif - -char * -getcwd (buf, len) - char *buf; - int len; -{ - char ourbuf[MAXPATHLEN]; - char *result; - - result = getwd (ourbuf); - if (result) { - if (strlen (ourbuf) >= len) { - errno = ERANGE; - return 0; - } - if (!buf) { - buf = (char*)malloc(len); - if (!buf) { - errno = ENOMEM; - return 0; - } - } - strcpy (buf, ourbuf); - } - return buf; -} diff --git a/gnu/egcs/libiberty/getopt.c b/gnu/egcs/libiberty/getopt.c deleted file mode 100644 index c41531e667d..00000000000 --- a/gnu/egcs/libiberty/getopt.c +++ /dev/null @@ -1,1056 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to drepper@gnu.org - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98 - Free Software Foundation, Inc. - - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@gnu.org. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. - Ditto for AIX 3.2 and <stdlib.h>. */ -#ifndef _NO_PROTO -# define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -# ifndef const -# define const -# endif -#endif - -#include <stdio.h> - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -# include <gnu-versions.h> -# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -# define ELIDE_CODE -# endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -# include <stdlib.h> -# include <unistd.h> -#endif /* GNU C library. */ - -#ifdef VMS -# include <unixlib.h> -# if HAVE_STRING_H - 0 -# include <string.h> -# endif -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -# ifdef HAVE_LIBINTL_H -# include <libintl.h> -# define _(msgid) gettext (msgid) -# else -# define _(msgid) (msgid) -# endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = NULL; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int optind = 1; - -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -# include <string.h> -# define my_index strchr -#else - -# if HAVE_STRING_H -# include <string.h> -# else -# if HAVE_STRINGS_H -# include <strings.h> -# endif -# endif - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -#ifndef getenv -extern char *getenv (); -#endif - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -# if (!defined __STDC__ || !__STDC__) && !defined strlen -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -# endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -/* Defined in getopt_init.c */ -extern char *__getopt_nonoption_flags; - -static int nonoption_flags_max_len; -static int nonoption_flags_len; - -static int original_argc; -static char *const *original_argv; - -/* Make sure the environment variable bash 2.0 puts in the environment - is valid for the getopt call we must make sure that the ARGV passed - to getopt is that one passed to the process. */ -static void -__attribute__ ((unused)) -store_args_and_env (int argc, char *const *argv) -{ - /* XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ - original_argc = argc; - original_argv = argv; -} -# ifdef text_set_element -text_set_element (__libc_subinit, store_args_and_env); -# endif /* text_set_element */ - -# define SWAP_FLAGS(ch1, ch2) \ - if (nonoption_flags_len > 0) \ - { \ - char __tmp = __getopt_nonoption_flags[ch1]; \ - __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ - __getopt_nonoption_flags[ch2] = __tmp; \ - } -#else /* !_LIBC */ -# define SWAP_FLAGS(ch1, ch2) -#endif /* _LIBC */ - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined __STDC__ && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - -#ifdef _LIBC - /* First make sure the handling of the `__getopt_nonoption_flags' - string can work normally. Our top argument must be in the range - of the string. */ - if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) - { - /* We must extend the array. The user plays games with us and - presents new arguments. */ - char *new_str = malloc (top + 1); - if (new_str == NULL) - nonoption_flags_len = nonoption_flags_max_len = 0; - else - { - memset (__mempcpy (new_str, __getopt_nonoption_flags, - nonoption_flags_max_len), - '\0', top + 1 - nonoption_flags_max_len); - nonoption_flags_max_len = top + 1; - __getopt_nonoption_flags = new_str; - } - } -#endif - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - SWAP_FLAGS (bottom + i, middle + i); - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined __STDC__ && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#ifdef _LIBC - if (posixly_correct == NULL - && argc == original_argc && argv == original_argv) - { - if (nonoption_flags_max_len == 0) - { - if (__getopt_nonoption_flags == NULL - || __getopt_nonoption_flags[0] == '\0') - nonoption_flags_max_len = -1; - else - { - const char *orig_str = __getopt_nonoption_flags; - int len = nonoption_flags_max_len = strlen (orig_str); - if (nonoption_flags_max_len < argc) - nonoption_flags_max_len = argc; - __getopt_nonoption_flags = - (char *) malloc (nonoption_flags_max_len); - if (__getopt_nonoption_flags == NULL) - nonoption_flags_max_len = -1; - else - memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), - '\0', nonoption_flags_max_len - len); - } - } - nonoption_flags_len = nonoption_flags_max_len; - } - else - nonoption_flags_len = 0; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns -1. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (optind == 0 || !__getopt_initialized) - { - if (optind == 0) - optind = 1; /* Don't scan ARGV[0], the program name. */ - optstring = _getopt_initialize (argc, argv, optstring); - __getopt_initialized = 1; - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#ifdef _LIBC -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && __getopt_nonoption_flags[optind] == '1')) -#else -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - { - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - - /* optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/gnu/egcs/libiberty/getopt1.c b/gnu/egcs/libiberty/getopt1.c deleted file mode 100644 index ff257374c33..00000000000 --- a/gnu/egcs/libiberty/getopt1.c +++ /dev/null @@ -1,190 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 - Free Software Foundation, Inc. - - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@gnu.org. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "getopt.h" - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include <stdio.h> - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -#include <gnu-versions.h> -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include <stdlib.h> -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -#include <stdio.h> - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/gnu/egcs/libiberty/getpagesize.c b/gnu/egcs/libiberty/getpagesize.c deleted file mode 100644 index 564d6c02312..00000000000 --- a/gnu/egcs/libiberty/getpagesize.c +++ /dev/null @@ -1,96 +0,0 @@ -/* Emulation of getpagesize() for systems that need it. */ - -/* - -NAME - - getpagesize -- return the number of bytes in page of memory - -SYNOPSIS - - int getpagesize (void) - -DESCRIPTION - - Returns the number of bytes in a page of memory. This is the - granularity of many of the system memory management routines. - No guarantee is made as to whether or not it is the same as the - basic memory management hardware page size. - -BUGS - - Is intended as a reasonable replacement for systems where this - is not provided as a system call. The value of 4096 may or may - not be correct for the systems where it is returned as the default - value. - -*/ - -#ifndef VMS - -#include "config.h" - -#include <sys/types.h> -#ifdef HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif - -#undef GNU_OUR_PAGESIZE -#if defined (HAVE_SYSCONF) && defined (HAVE_UNISTD_H) -#include <unistd.h> -#ifdef _SC_PAGESIZE -#define GNU_OUR_PAGESIZE sysconf(_SC_PAGESIZE) -#endif -#endif - -#ifndef GNU_OUR_PAGESIZE -# ifdef PAGESIZE -# define GNU_OUR_PAGESIZE PAGESIZE -# else /* no PAGESIZE */ -# ifdef EXEC_PAGESIZE -# define GNU_OUR_PAGESIZE EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define GNU_OUR_PAGESIZE (NBPG * CLSIZE) -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define GNU_OUR_PAGESIZE NBPC -# else /* no NBPC */ -# define GNU_OUR_PAGESIZE 4096 /* Just punt and use reasonable value */ -# endif /* NBPC */ -# endif /* NBPG */ -# endif /* EXEC_PAGESIZE */ -# endif /* PAGESIZE */ -#endif /* GNU_OUR_PAGESIZE */ - -int -getpagesize () -{ - return (GNU_OUR_PAGESIZE); -} - -#else /* VMS */ - -#if 0 /* older distributions of gcc-vms are missing <syidef.h> */ -#include <syidef.h> -#endif -#ifndef SYI$_PAGE_SIZE /* VMS V5.4 and earlier didn't have this yet */ -#define SYI$_PAGE_SIZE 4452 -#endif -extern unsigned long lib$getsyi(const unsigned short *,...); - -int getpagesize () -{ - long pagsiz = 0L; - unsigned short itmcod = SYI$_PAGE_SIZE; - - (void) lib$getsyi (&itmcod, (void *) &pagsiz); - if (pagsiz == 0L) - pagsiz = 512L; /* VAX default */ - return (int) pagsiz; -} - -#endif /* VMS */ diff --git a/gnu/egcs/libiberty/getpwd.c b/gnu/egcs/libiberty/getpwd.c deleted file mode 100644 index de6e0397648..00000000000 --- a/gnu/egcs/libiberty/getpwd.c +++ /dev/null @@ -1,115 +0,0 @@ -/* getpwd.c - get the working directory */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/types.h> - -#include <errno.h> -#ifndef errno -extern int errno; -#endif - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif -#if HAVE_SYS_STAT_H -#include <sys/stat.h> -#endif - -/* Prototype these in case the system headers don't provide them. */ -extern char *getpwd (); -extern char *getwd (); - -#include "libiberty.h" - -/* Virtually every UN*X system now in common use (except for pre-4.3-tahoe - BSD systems) now provides getcwd as called for by POSIX. Allow for - the few exceptions to the general rule here. */ - -#if !defined(HAVE_GETCWD) && defined(HAVE_GETWD) -#define getcwd(buf,len) getwd(buf) -#endif - -#ifdef MAXPATHLEN -#define GUESSPATHLEN (MAXPATHLEN + 1) -#else -#define GUESSPATHLEN 100 -#endif - -#if !(defined (VMS) || (defined(_WIN32) && !defined(__CYGWIN__))) - -/* Get the working directory. Use the PWD environment variable if it's - set correctly, since this is faster and gives more uniform answers - to the user. Yield the working directory if successful; otherwise, - yield 0 and set errno. */ - -char * -getpwd () -{ - static char *pwd; - static int failure_errno; - - char *p = pwd; - size_t s; - struct stat dotstat, pwdstat; - - if (!p && !(errno = failure_errno)) - { - if (! ((p = getenv ("PWD")) != 0 - && *p == '/' - && stat (p, &pwdstat) == 0 - && stat (".", &dotstat) == 0 - && dotstat.st_ino == pwdstat.st_ino - && dotstat.st_dev == pwdstat.st_dev)) - - /* The shortcut didn't work. Try the slow, ``sure'' way. */ - for (s = GUESSPATHLEN; ! getcwd (p = xmalloc (s), s); s *= 2) - { - int e = errno; - free (p); -#ifdef ERANGE - if (e != ERANGE) -#endif - { - errno = failure_errno = e; - p = 0; - break; - } - } - - /* Cache the result. This assumes that the program does - not invoke chdir between calls to getpwd. */ - pwd = p; - } - return p; -} - -#else /* VMS || _WIN32 && !__CYGWIN__ */ - -#ifndef MAXPATHLEN -#define MAXPATHLEN 255 -#endif - -char * -getpwd () -{ - static char *pwd = 0; - - if (!pwd) - pwd = getcwd (xmalloc (MAXPATHLEN + 1), MAXPATHLEN + 1 -#ifdef VMS - , 0 -#endif - ); - return pwd; -} - -#endif /* VMS || _WIN32 && !__CYGWIN__ */ diff --git a/gnu/egcs/libiberty/getruntime.c b/gnu/egcs/libiberty/getruntime.c deleted file mode 100644 index b855ea6e82f..00000000000 --- a/gnu/egcs/libiberty/getruntime.c +++ /dev/null @@ -1,90 +0,0 @@ -/* Return time used so far, in microseconds. - Copyright (C) 1994, 1999 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "config.h" - -#include "ansidecl.h" -#include "libiberty.h" - -/* There are several ways to get elapsed execution time; unfortunately no - single way is available for all host systems, nor are there reliable - ways to find out which way is correct for a given host. */ - -#include <time.h> - -#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H) -#include <sys/time.h> -#include <sys/resource.h> -#endif - -#ifdef HAVE_TIMES -#ifdef HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif -#include <sys/times.h> -#endif - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif - -/* This is a fallback; if wrong, it will likely make obviously wrong - results. */ - -#ifndef CLOCKS_PER_SEC -#define CLOCKS_PER_SEC 1 -#endif - -#ifdef _SC_CLK_TCK -#define GNU_HZ sysconf(_SC_CLK_TCK) -#else -#ifdef HZ -#define GNU_HZ HZ -#else -#ifdef CLOCKS_PER_SEC -#define GNU_HZ CLOCKS_PER_SEC -#endif -#endif -#endif - -long -get_run_time () -{ -#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H) - struct rusage rusage; - - getrusage (0, &rusage); - return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec - + rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec); -#else /* ! HAVE_GETRUSAGE */ -#ifdef HAVE_TIMES - struct tms tms; - - times (&tms); - return (tms.tms_utime + tms.tms_stime) * (1000000 / GNU_HZ); -#else /* ! HAVE_TIMES */ - /* Fall back on clock and hope it's correctly implemented. */ - const long clocks_per_sec = CLOCKS_PER_SEC; - if (clocks_per_sec <= 1000000) - return clock () * (1000000 / clocks_per_sec); - else - return clock () / clocks_per_sec; -#endif /* HAVE_TIMES */ -#endif /* HAVE_GETRUSAGE */ -} diff --git a/gnu/egcs/libiberty/hashtab.c b/gnu/egcs/libiberty/hashtab.c deleted file mode 100644 index c59e3159520..00000000000 --- a/gnu/egcs/libiberty/hashtab.c +++ /dev/null @@ -1,305 +0,0 @@ -/* An expandable hash tables datatype. - Copyright (C) 1999 Free Software Foundation, Inc. - Contributed by Vladimir Makarov (vmakarov@cygnus.com). - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* This package implements basic hash table functionality. It is possible - to search for an entry, create an entry and destroy an entry. - - Elements in the table are generic pointers. - - The size of the table is not fixed; if the occupancy of the table - grows too high the hash table will be expanded. - - The abstract data implementation is based on generalized Algorithm D - from Knuth's book "The art of computer programming". Hash table is - expanded by creation of new hash table and transferring elements from - the old table to the new table. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#include "libiberty.h" -#include "hashtab.h" - -#ifdef HASHTAB_STATS -/* The following variable is used for debugging. Its value is number - of all calls of `find_hash_table_entry' for all hash tables. */ - -static int all_searches = 0; - -/* The following variable is used for debugging. Its value is number - of collisions fixed for time of work with all hash tables. */ - -static int all_collisions = 0; - -/* The following variable is used for debugging. Its value is number - of all table expansions fixed for time of work with all hash - tables. */ - -static int all_expansions = 0; -#endif - -/* This macro defines reserved value for empty table entry. */ - -#define EMPTY_ENTRY NULL - -/* This macro defines reserved value for table entry which contained - a deleted element. */ - -#define DELETED_ENTRY ((void *) 1) - -/* The following function returns the nearest prime number which is - greater than given source number. */ - -static unsigned long -higher_prime_number (number) - unsigned long number; -{ - unsigned long i; - - for (number = (number / 2) * 2 + 3;; number += 2) - { - for (i = 3; i * i <= number; i += 2) - if (number % i == 0) - break; - if (i * i > number) - return number; - } -} - -/* This function creates table with length slightly longer than given - source length. Created hash table is initiated as empty (all the - hash table entries are EMPTY_ENTRY). The function returns the - created hash table. */ - -hash_table_t -create_hash_table (size, hash_function, eq_function) - size_t size; - unsigned (*hash_function) PARAMS ((hash_table_entry_t)); - int (*eq_function) PARAMS ((hash_table_entry_t, hash_table_entry_t)); -{ - hash_table_t result; - - size = higher_prime_number (size); - result = (hash_table_t) xmalloc (sizeof (*result)); - result->entries - = (hash_table_entry_t *) xmalloc (size * sizeof (hash_table_entry_t)); - result->size = size; - result->hash_function = hash_function; - result->eq_function = eq_function; -#ifdef HASHTAB_STATS - result->searches = 0; - result->collisions = 0; -#endif - empty_hash_table (result); - return result; -} - -/* This function frees all memory allocated for given hash table. - Naturally the hash table must already exist. */ - -void -delete_hash_table (htab) - hash_table_t htab; -{ - free (htab->entries); - free (htab); -} - -/* This function clears all entries in the given hash table. */ - -void -empty_hash_table (htab) - hash_table_t htab; -{ - memset (htab->entries, 0, htab->size * sizeof (hash_table_entry_t)); - htab->number_of_elements = 0; - htab->number_of_deleted_elements = 0; -} - -/* The following function changes size of memory allocated for the - entries and repeatedly inserts the table elements. The occupancy - of the table after the call will be about 50%. Naturally the hash - table must already exist. Remember also that the place of the - table entries is changed. */ - -static void -expand_hash_table (htab) - hash_table_t htab; -{ - hash_table_t new_htab; - hash_table_entry_t *entry_ptr; - hash_table_entry_t *new_entry_ptr; - - new_htab = create_hash_table (htab->number_of_elements * 2, - htab->hash_function, htab->eq_function); - for (entry_ptr = htab->entries; entry_ptr < htab->entries + htab->size; - entry_ptr++) - if (*entry_ptr != EMPTY_ENTRY && *entry_ptr != DELETED_ENTRY) - { - new_entry_ptr = find_hash_table_entry (new_htab, *entry_ptr, 1); - *new_entry_ptr = (*entry_ptr); - } - free (htab->entries); - *htab = (*new_htab); - free (new_htab); -} - -/* This function searches for hash table entry which contains element - equal to given value or empty entry in which given value can be - placed (if the element with given value does not exist in the - table). The function works in two regimes. The first regime is - used only for search. The second is used for search and - reservation empty entry for given value. The table is expanded if - occupancy (taking into accout also deleted elements) is more than - 75%. Naturally the hash table must already exist. If reservation - flag is TRUE then the element with given value should be inserted - into the table entry before another call of - `find_hash_table_entry'. */ - -hash_table_entry_t * -find_hash_table_entry (htab, element, reserve) - hash_table_t htab; - hash_table_entry_t element; - int reserve; -{ - hash_table_entry_t *entry_ptr; - hash_table_entry_t *first_deleted_entry_ptr; - unsigned index, hash_value, secondary_hash_value; - - if (htab->size * 3 <= htab->number_of_elements * 4) - { -#ifdef HASHTAB_STATS - all_expansions++; -#endif - expand_hash_table (htab); - } - hash_value = (*htab->hash_function) (element); - secondary_hash_value = 1 + hash_value % (htab->size - 2); - index = hash_value % htab->size; -#ifdef HASHTAB_STATS - htab->searches++; - all_searches++; -#endif - first_deleted_entry_ptr = NULL; -#ifdef HASHTAB_STATS - for (;;htab->collisions++, all_collisions++) -#else - for (;;) -#endif - { - entry_ptr = htab->entries + index; - if (*entry_ptr == EMPTY_ENTRY) - { - if (reserve) - { - htab->number_of_elements++; - if (first_deleted_entry_ptr != NULL) - { - entry_ptr = first_deleted_entry_ptr; - *entry_ptr = DELETED_ENTRY; - } - } - break; - } - else if (*entry_ptr != DELETED_ENTRY) - { - if ((*htab->eq_function) (*entry_ptr, element)) - break; - } - else if (first_deleted_entry_ptr == NULL) - first_deleted_entry_ptr = entry_ptr; - index += secondary_hash_value; - if (index >= htab->size) - index -= htab->size; - } - return entry_ptr; -} - -/* This function deletes element with given value from hash table. - The hash table entry value will be `DELETED_ENTRY' after the - function call. Naturally the hash table must already exist. Hash - table entry for given value should be not empty (or deleted). */ - -void -remove_element_from_hash_table_entry (htab, element) - hash_table_t htab; - hash_table_entry_t element; -{ - hash_table_entry_t *entry_ptr; - - entry_ptr = find_hash_table_entry (htab, element, 0); - *entry_ptr = DELETED_ENTRY; - htab->number_of_deleted_elements++; -} - -/* The following function returns current size of given hash table. */ - -size_t -hash_table_size (htab) - hash_table_t htab; -{ - return htab->size; -} - -/* The following function returns current number of elements in given - hash table. */ - -size_t -hash_table_elements_number (htab) - hash_table_t htab; -{ - return htab->number_of_elements - htab->number_of_deleted_elements; -} - -#ifdef HASHTAB_STATS -/* The following function returns number of percents of fixed - collisions during all work with given hash table. */ - -int -hash_table_collisions (htab) - hash_table_t htab; -{ - int searches; - - searches = htab->searches; - if (searches == 0) - searches++; - return htab->collisions * 100 / searches; -} - -/* The following function returns number of percents of fixed - collisions during all work with all hash tables. */ - -int -all_hash_table_collisions () -{ - int searches; - - searches = all_searches; - if (searches == 0) - searches++; - return all_collisions * 100 / searches; -} -#endif diff --git a/gnu/egcs/libiberty/hex.c b/gnu/egcs/libiberty/hex.c deleted file mode 100644 index 3a2eef03d4c..00000000000 --- a/gnu/egcs/libiberty/hex.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Hex character manipulation support. - Copyright (C) 1995 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "libiberty.h" - -char _hex_value[_hex_array_size]; - -void hex_init () -{ - int i; - for (i = 0; i < _hex_array_size; i++) - _hex_value[i] = _hex_bad; - for (i = 0; i < 10; i++) - _hex_value['0' + i] = i; - for (i = 0; i < 6; i++) - _hex_value['a' + i] = _hex_value['A' + i] = 10 + i; -} diff --git a/gnu/egcs/libiberty/index.c b/gnu/egcs/libiberty/index.c deleted file mode 100644 index e5a00f54d94..00000000000 --- a/gnu/egcs/libiberty/index.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Stub implementation of (obsolete) index(). */ - -extern char * strchr(); - -char * -index (s, c) - char *s; - int c; -{ - return strchr (s, c); -} diff --git a/gnu/egcs/libiberty/insque.c b/gnu/egcs/libiberty/insque.c deleted file mode 100644 index 775019f8fff..00000000000 --- a/gnu/egcs/libiberty/insque.c +++ /dev/null @@ -1,50 +0,0 @@ -/* insque(3C) routines - This file is in the public domain. */ - -/* -NAME - insque, remque -- insert, remove an element from a queue - -SYNOPSIS - struct qelem { - struct qelem *q_forw; - struct qelem *q_back; - char q_data[]; - }; - - void insque (struct qelem *elem, struct qelem *pred) - - void remque (struct qelem *elem) - -DESCRIPTION - Routines to manipulate queues built from doubly linked lists. - The insque routine inserts ELEM in the queue immediately after - PRED. The remque routine removes ELEM from its containing queue. -*/ - - -struct qelem { - struct qelem *q_forw; - struct qelem *q_back; -}; - - -void -insque (elem, pred) - struct qelem *elem; - struct qelem *pred; -{ - elem -> q_forw = pred -> q_forw; - pred -> q_forw -> q_back = elem; - elem -> q_back = pred; - pred -> q_forw = elem; -} - - -void -remque (elem) - struct qelem *elem; -{ - elem -> q_forw -> q_back = elem -> q_back; - elem -> q_back -> q_forw = elem -> q_forw; -} diff --git a/gnu/egcs/libiberty/makefile.dos b/gnu/egcs/libiberty/makefile.dos deleted file mode 100644 index 7eba62c3395..00000000000 --- a/gnu/egcs/libiberty/makefile.dos +++ /dev/null @@ -1,29 +0,0 @@ -CFLAGS=-O2 - -OBJS = \ - argv.o \ - basename.o \ - concat.o \ - cplus-dem.o \ - fdmatch.o \ - floatformat.o \ - getopt.o \ - getopt1.o \ - getruntime.o \ - hex.o \ - msdos.o \ - obstack.o \ - spaces.o \ - strerror.o \ - strsignal.o \ - xatexit.o \ - xexit.o \ - xmalloc.o \ - $E - -.c.o: - gcc -I../include $(CFLAGS) -c $< - -libiberty.a : $(OBJS) - -rm libiberty.a - ar rvs libiberty.a $(OBJS) diff --git a/gnu/egcs/libiberty/makefile.vms b/gnu/egcs/libiberty/makefile.vms deleted file mode 100644 index b61b51290da..00000000000 --- a/gnu/egcs/libiberty/makefile.vms +++ /dev/null @@ -1,33 +0,0 @@ -# -# Makefile for libiberty under openVMS/Alpha -# -# For use with gnu-make for vms -# -# Created by Klaus K"ampf, kkaempf@progis.de -# -# - -OBJS=bcopy.obj,bcmp.obj,getopt.obj,obstack.obj,xexit.obj,xmalloc.obj,hex.obj,\ - getopt1.obj,cplus-dem.obj,strncasecmp.obj,strcasecmp.obj,strdup.obj,\ - concat.obj,getruntime.obj,getpagesize.obj,alloca.obj,xstrerror.obj,\ - xstrdup.obj,xatexit.obj,choose-temp.obj,fnmatch.obj,objalloc.obj - -ifeq ($(CC),gcc) -CFLAGS=/include=([],[-.include]) -else -# assume dec c -CFLAGS=/noopt/debug/include=([],[-.include])/define=("const=")/warnings=disable=(missingreturn,implicitfunc) -endif - -libiberty.olb: config.h alloca-conf.h $(OBJS) - purge - lib/create libiberty *.obj - -config.h: config.h-vms - $(CP) $< $@ - -clean: - $$ purge - $(RM) config.h; - $(RM) *.obj; - $(RM) libiberty.olb; diff --git a/gnu/egcs/libiberty/md5.c b/gnu/egcs/libiberty/md5.c deleted file mode 100644 index 20c3cd12679..00000000000 --- a/gnu/egcs/libiberty/md5.c +++ /dev/null @@ -1,421 +0,0 @@ -/* md5.c - Functions to compute MD5 message digest of files or memory blocks - according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - - NOTE: This source is derived from an old version taken from the GNU C - Library (glibc). - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <sys/types.h> - -#if STDC_HEADERS || defined _LIBC -# include <stdlib.h> -# include <string.h> -#else -# ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# endif -#endif - -#include "ansidecl.h" -#include "md5.h" - -#ifdef _LIBC -# include <endian.h> -# if __BYTE_ORDER == __BIG_ENDIAN -# define WORDS_BIGENDIAN 1 -# endif -#endif - -#ifdef WORDS_BIGENDIAN -# define SWAP(n) \ - (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) -#else -# define SWAP(n) (n) -#endif - - -/* This array contains the bytes used to pad the buffer to the next - 64-byte boundary. (RFC 1321, 3.1: Step 1) */ -static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; - - -/* Initialize structure containing state of computation. - (RFC 1321, 3.3: Step 3) */ -void -md5_init_ctx (ctx) - struct md5_ctx *ctx; -{ - ctx->A = 0x67452301; - ctx->B = 0xefcdab89; - ctx->C = 0x98badcfe; - ctx->D = 0x10325476; - - ctx->total[0] = ctx->total[1] = 0; - ctx->buflen = 0; -} - -/* Put result from CTX in first 16 bytes following RESBUF. The result - must be in little endian byte order. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ -void * -md5_read_ctx (ctx, resbuf) - const struct md5_ctx *ctx; - void *resbuf; -{ - ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); - ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); - ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); - ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); - - return resbuf; -} - -/* Process the remaining bytes in the internal buffer and the usual - prolog according to the standard and write the result to RESBUF. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ -void * -md5_finish_ctx (ctx, resbuf) - struct md5_ctx *ctx; - void *resbuf; -{ - /* Take yet unprocessed bytes into account. */ - md5_uint32 bytes = ctx->buflen; - size_t pad; - - /* Now count remaining bytes. */ - ctx->total[0] += bytes; - if (ctx->total[0] < bytes) - ++ctx->total[1]; - - pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; - memcpy (&ctx->buffer[bytes], fillbuf, pad); - - /* Put the 64-bit file length in *bits* at the end of the buffer. */ - *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); - *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | - (ctx->total[0] >> 29)); - - /* Process last bytes. */ - md5_process_block (ctx->buffer, bytes + pad + 8, ctx); - - return md5_read_ctx (ctx, resbuf); -} - -/* Compute MD5 message digest for bytes read from STREAM. The - resulting message digest number will be written into the 16 bytes - beginning at RESBLOCK. */ -int -md5_stream (stream, resblock) - FILE *stream; - void *resblock; -{ - /* Important: BLOCKSIZE must be a multiple of 64. */ -#define BLOCKSIZE 4096 - struct md5_ctx ctx; - char buffer[BLOCKSIZE + 72]; - size_t sum; - - /* Initialize the computation context. */ - md5_init_ctx (&ctx); - - /* Iterate over full file contents. */ - while (1) - { - /* We read the file in blocks of BLOCKSIZE bytes. One call of the - computation function processes the whole buffer so that with the - next round of the loop another block can be read. */ - size_t n; - sum = 0; - - /* Read block. Take care for partial reads. */ - do - { - n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); - - sum += n; - } - while (sum < BLOCKSIZE && n != 0); - if (n == 0 && ferror (stream)) - return 1; - - /* If end of file is reached, end the loop. */ - if (n == 0) - break; - - /* Process buffer with BLOCKSIZE bytes. Note that - BLOCKSIZE % 64 == 0 - */ - md5_process_block (buffer, BLOCKSIZE, &ctx); - } - - /* Add the last bytes if necessary. */ - if (sum > 0) - md5_process_bytes (buffer, sum, &ctx); - - /* Construct result in desired memory. */ - md5_finish_ctx (&ctx, resblock); - return 0; -} - -/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The - result is always in little endian byte order, so that a byte-wise - output yields to the wanted ASCII representation of the message - digest. */ -void * -md5_buffer (buffer, len, resblock) - const char *buffer; - size_t len; - void *resblock; -{ - struct md5_ctx ctx; - - /* Initialize the computation context. */ - md5_init_ctx (&ctx); - - /* Process whole buffer but last len % 64 bytes. */ - md5_process_bytes (buffer, len, &ctx); - - /* Put result in desired memory area. */ - return md5_finish_ctx (&ctx, resblock); -} - - -void -md5_process_bytes (buffer, len, ctx) - const void *buffer; - size_t len; - struct md5_ctx *ctx; -{ - /* When we already have some bits in our internal buffer concatenate - both inputs first. */ - if (ctx->buflen != 0) - { - size_t left_over = ctx->buflen; - size_t add = 128 - left_over > len ? len : 128 - left_over; - - memcpy (&ctx->buffer[left_over], buffer, add); - ctx->buflen += add; - - if (left_over + add > 64) - { - md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx); - /* The regions in the following copy operation cannot overlap. */ - memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], - (left_over + add) & 63); - ctx->buflen = (left_over + add) & 63; - } - - buffer = (const char *) buffer + add; - len -= add; - } - - /* Process available complete blocks. */ - if (len > 64) - { - md5_process_block (buffer, len & ~63, ctx); - buffer = (const char *) buffer + (len & ~63); - len &= 63; - } - - /* Move remaining bytes in internal buffer. */ - if (len > 0) - { - memcpy (ctx->buffer, buffer, len); - ctx->buflen = len; - } -} - - -/* These are the four functions used in the four steps of the MD5 algorithm - and defined in the RFC 1321. The first function is a little bit optimized - (as found in Colin Plumbs public domain implementation). */ -/* #define FF(b, c, d) ((b & c) | (~b & d)) */ -#define FF(b, c, d) (d ^ (b & (c ^ d))) -#define FG(b, c, d) FF (d, b, c) -#define FH(b, c, d) (b ^ c ^ d) -#define FI(b, c, d) (c ^ (b | ~d)) - -/* Process LEN bytes of BUFFER, accumulating context into CTX. - It is assumed that LEN % 64 == 0. */ - -void -md5_process_block (buffer, len, ctx) - const void *buffer; - size_t len; - struct md5_ctx *ctx; -{ - md5_uint32 correct_words[16]; - const md5_uint32 *words = buffer; - size_t nwords = len / sizeof (md5_uint32); - const md5_uint32 *endp = words + nwords; - md5_uint32 A = ctx->A; - md5_uint32 B = ctx->B; - md5_uint32 C = ctx->C; - md5_uint32 D = ctx->D; - - /* First increment the byte count. RFC 1321 specifies the possible - length of the file up to 2^64 bits. Here we only compute the - number of bytes. Do a double word increment. */ - ctx->total[0] += len; - if (ctx->total[0] < len) - ++ctx->total[1]; - - /* Process all bytes in the buffer with 64 bytes in each round of - the loop. */ - while (words < endp) - { - md5_uint32 *cwp = correct_words; - md5_uint32 A_save = A; - md5_uint32 B_save = B; - md5_uint32 C_save = C; - md5_uint32 D_save = D; - - /* First round: using the given function, the context and a constant - the next context is computed. Because the algorithms processing - unit is a 32-bit word and it is determined to work on words in - little endian byte order we perhaps have to change the byte order - before the computation. To reduce the work for the next steps - we store the swapped words in the array CORRECT_WORDS. */ - -#define OP(a, b, c, d, s, T) \ - do \ - { \ - a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ - ++words; \ - CYCLIC (a, s); \ - a += b; \ - } \ - while (0) - - /* It is unfortunate that C does not provide an operator for - cyclic rotation. Hope the C compiler is smart enough. */ -#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s))) - - /* Before we start, one word to the strange constants. - They are defined in RFC 1321 as - - T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 - */ - - /* Round 1. */ - OP (A, B, C, D, 7, 0xd76aa478); - OP (D, A, B, C, 12, 0xe8c7b756); - OP (C, D, A, B, 17, 0x242070db); - OP (B, C, D, A, 22, 0xc1bdceee); - OP (A, B, C, D, 7, 0xf57c0faf); - OP (D, A, B, C, 12, 0x4787c62a); - OP (C, D, A, B, 17, 0xa8304613); - OP (B, C, D, A, 22, 0xfd469501); - OP (A, B, C, D, 7, 0x698098d8); - OP (D, A, B, C, 12, 0x8b44f7af); - OP (C, D, A, B, 17, 0xffff5bb1); - OP (B, C, D, A, 22, 0x895cd7be); - OP (A, B, C, D, 7, 0x6b901122); - OP (D, A, B, C, 12, 0xfd987193); - OP (C, D, A, B, 17, 0xa679438e); - OP (B, C, D, A, 22, 0x49b40821); - - /* For the second to fourth round we have the possibly swapped words - in CORRECT_WORDS. Redefine the macro to take an additional first - argument specifying the function to use. */ -#undef OP -#define OP(f, a, b, c, d, k, s, T) \ - do \ - { \ - a += f (b, c, d) + correct_words[k] + T; \ - CYCLIC (a, s); \ - a += b; \ - } \ - while (0) - - /* Round 2. */ - OP (FG, A, B, C, D, 1, 5, 0xf61e2562); - OP (FG, D, A, B, C, 6, 9, 0xc040b340); - OP (FG, C, D, A, B, 11, 14, 0x265e5a51); - OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); - OP (FG, A, B, C, D, 5, 5, 0xd62f105d); - OP (FG, D, A, B, C, 10, 9, 0x02441453); - OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); - OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); - OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); - OP (FG, D, A, B, C, 14, 9, 0xc33707d6); - OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); - OP (FG, B, C, D, A, 8, 20, 0x455a14ed); - OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); - OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); - OP (FG, C, D, A, B, 7, 14, 0x676f02d9); - OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); - - /* Round 3. */ - OP (FH, A, B, C, D, 5, 4, 0xfffa3942); - OP (FH, D, A, B, C, 8, 11, 0x8771f681); - OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); - OP (FH, B, C, D, A, 14, 23, 0xfde5380c); - OP (FH, A, B, C, D, 1, 4, 0xa4beea44); - OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); - OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); - OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); - OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); - OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); - OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); - OP (FH, B, C, D, A, 6, 23, 0x04881d05); - OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); - OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); - OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); - OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); - - /* Round 4. */ - OP (FI, A, B, C, D, 0, 6, 0xf4292244); - OP (FI, D, A, B, C, 7, 10, 0x432aff97); - OP (FI, C, D, A, B, 14, 15, 0xab9423a7); - OP (FI, B, C, D, A, 5, 21, 0xfc93a039); - OP (FI, A, B, C, D, 12, 6, 0x655b59c3); - OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); - OP (FI, C, D, A, B, 10, 15, 0xffeff47d); - OP (FI, B, C, D, A, 1, 21, 0x85845dd1); - OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); - OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); - OP (FI, C, D, A, B, 6, 15, 0xa3014314); - OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); - OP (FI, A, B, C, D, 4, 6, 0xf7537e82); - OP (FI, D, A, B, C, 11, 10, 0xbd3af235); - OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); - OP (FI, B, C, D, A, 9, 21, 0xeb86d391); - - /* Add the starting values of the context. */ - A += A_save; - B += B_save; - C += C_save; - D += D_save; - } - - /* Put checksum in context given as argument. */ - ctx->A = A; - ctx->B = B; - ctx->C = C; - ctx->D = D; -} diff --git a/gnu/egcs/libiberty/memchr.c b/gnu/egcs/libiberty/memchr.c deleted file mode 100644 index cce30039437..00000000000 --- a/gnu/egcs/libiberty/memchr.c +++ /dev/null @@ -1,60 +0,0 @@ -/* -FUNCTION - <<memchr>>---find character in memory - -INDEX - memchr - -ANSI_SYNOPSIS - #include <string.h> - void *memchr(const void *<[src]>, int <[c]>, size_t <[length]>); - -TRAD_SYNOPSIS - #include <string.h> - void *memchr(<[src]>, <[c]>, <[length]>) - void *<[src]>; - void *<[c]>; - size_t <[length]>; - -DESCRIPTION - This function searches memory starting at <<*<[src]>>> for the - character <[c]>. The search only ends with the first - occurrence of <[c]>, or after <[length]> characters; in - particular, <<NULL>> does not terminate the search. - -RETURNS - If the character <[c]> is found within <[length]> characters - of <<*<[src]>>>, a pointer to the character is returned. If - <[c]> is not found, then <<NULL>> is returned. - -PORTABILITY -<<memchr>> requires no supporting OS subroutines. - -QUICKREF - memchr ansi pure - -*/ - -#include <ansidecl.h> -#ifdef __STDC__ -#include <stddef.h> -#else -#define size_t unsigned long -#endif - -PTR -memchr (src_void, c, length) - register const PTR src_void; - int c; - size_t length; -{ - const unsigned char *src = (const unsigned char *)src_void; - - while (--length >= 0) - { - if (*src == c) - return (PTR)src; - src++; - } - return NULL; -} diff --git a/gnu/egcs/libiberty/memcmp.c b/gnu/egcs/libiberty/memcmp.c deleted file mode 100644 index 127ae0c8019..00000000000 --- a/gnu/egcs/libiberty/memcmp.c +++ /dev/null @@ -1,38 +0,0 @@ -/* memcmp -- compare two memory regions. - This function is in the public domain. */ - -/* -NAME - memcmp -- compare two memory regions - -SYNOPSIS - int memcmp (const void *from, const void *to, size_t count) - -DESCRIPTION - Compare two memory regions and return less than, - equal to, or greater than zero, according to lexicographical - ordering of the compared regions. -*/ - -#include <ansidecl.h> -#ifdef __STDC__ -#include <stddef.h> -#else -#define size_t unsigned long -#endif - -int -DEFUN(memcmp, (str1, str2, count), - const PTR str1 AND const PTR str2 AND size_t count) -{ - register unsigned char *s1 = (unsigned char*)str1; - register unsigned char *s2 = (unsigned char*)str2; - - while (count-- > 0) - { - if (*s1++ != *s2++) - return s1[-1] < s2[-1] ? -1 : 1; - } - return 0; -} - diff --git a/gnu/egcs/libiberty/memcpy.c b/gnu/egcs/libiberty/memcpy.c deleted file mode 100644 index 707a9f57385..00000000000 --- a/gnu/egcs/libiberty/memcpy.c +++ /dev/null @@ -1,28 +0,0 @@ -/* memcpy (the standard C function) - This function is in the public domain. */ - -/* -NAME - memcpy -- copy memory regions of arbitary length - -SYNOPSIS - void* memcpy (void *out, const void *in, size_t n); - -DESCRIPTION - Copy LENGTH bytes from memory region pointed to by IN to memory - region pointed to by OUT. -*/ - -#include <ansidecl.h> -#ifdef __STDC__ -#include <stddef.h> -#else -#define size_t unsigned long -#endif - -PTR -DEFUN(memcpy, (out, in, length), PTR out AND const PTR in AND size_t length) -{ - bcopy(in, out, length); - return out; -} diff --git a/gnu/egcs/libiberty/memmove.c b/gnu/egcs/libiberty/memmove.c deleted file mode 100644 index 176c326ef2b..00000000000 --- a/gnu/egcs/libiberty/memmove.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Wrapper to implement ANSI C's memmove using BSD's bcopy. */ -/* This function is in the public domain. --Per Bothner. */ -#include <ansidecl.h> -#ifdef __STDC__ -#include <stddef.h> -#else -#define size_t unsigned long -#endif - -PTR -memmove (s1, s2, n) - PTR s1; - const PTR s2; - size_t n; -{ - bcopy (s2, s1, n); - return s1; -} diff --git a/gnu/egcs/libiberty/memset.c b/gnu/egcs/libiberty/memset.c deleted file mode 100644 index 5f54831e83c..00000000000 --- a/gnu/egcs/libiberty/memset.c +++ /dev/null @@ -1,19 +0,0 @@ -/* memset - This implementation is in the public domain. */ - -#include <ansidecl.h> -#ifdef __STDC__ -#include <stddef.h> -#else -#define size_t unsigned long -#endif - -PTR -DEFUN(memset, (dest, val, len), - PTR dest AND register int val AND register size_t len) -{ - register unsigned char *ptr = (unsigned char*)dest; - while (len-- > 0) - *ptr++ = val; - return dest; -} diff --git a/gnu/egcs/libiberty/mkstemps.c b/gnu/egcs/libiberty/mkstemps.c deleted file mode 100644 index 16c16a23263..00000000000 --- a/gnu/egcs/libiberty/mkstemps.c +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright (C) 1991, 1992, 1996, 1998 Free Software Foundation, Inc. - This file is derived from mkstemp.c from the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#include <errno.h> -#include <stdio.h> -#include <fcntl.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif -#include "ansidecl.h" - -/* We need to provide a type for gcc_uint64_t. */ -#ifdef __GNUC__ -typedef unsigned long long gcc_uint64_t; -#else -typedef unsigned long gcc_uint64_t; -#endif - -#ifndef TMP_MAX -#define TMP_MAX 16384 -#endif - -/* Generate a unique temporary file name from TEMPLATE. - - TEMPLATE has the form: - - <path>/ccXXXXXX<suffix> - - SUFFIX_LEN tells us how long <suffix> is (it can be zero length). - - The last six characters of TEMPLATE before <suffix> must be "XXXXXX"; - they are replaced with a string that makes the filename unique. - - Returns a file descriptor open on the file for reading and writing. */ -int -mkstemps (template, suffix_len) - char *template; - int suffix_len; -{ - static const char letters[] - = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - static gcc_uint64_t value; -#ifdef HAVE_GETTIMEOFDAY - struct timeval tv; -#endif - char *XXXXXX; - size_t len; - int count; - - len = strlen (template); - - if ((int) len < 6 + suffix_len - || strncmp (&template[len - 6 - suffix_len], "XXXXXX", 6)) - { - return -1; - } - - XXXXXX = &template[len - 6 - suffix_len]; - -#ifdef HAVE_GETTIMEOFDAY - /* Get some more or less random data. */ - gettimeofday (&tv, NULL); - value += ((gcc_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid (); -#else - value += getpid (); -#endif - - for (count = 0; count < TMP_MAX; ++count) - { - gcc_uint64_t v = value; - int fd; - - /* Fill in the random bits. */ - XXXXXX[0] = letters[v % 62]; - v /= 62; - XXXXXX[1] = letters[v % 62]; - v /= 62; - XXXXXX[2] = letters[v % 62]; - v /= 62; - XXXXXX[3] = letters[v % 62]; - v /= 62; - XXXXXX[4] = letters[v % 62]; - v /= 62; - XXXXXX[5] = letters[v % 62]; - - fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600); - if (fd >= 0) - /* The file does not exist. */ - return fd; - - /* This is a random value. It is only necessary that the next - TMP_MAX values generated by adding 7777 to VALUE are different - with (module 2^32). */ - value += 7777; - } - - /* We return the null string if we can't find a unique file name. */ - template[0] = '\0'; - return -1; -} diff --git a/gnu/egcs/libiberty/mpw-config.in b/gnu/egcs/libiberty/mpw-config.in deleted file mode 100644 index 2a21802148d..00000000000 --- a/gnu/egcs/libiberty/mpw-config.in +++ /dev/null @@ -1,7 +0,0 @@ -# MPW configuration fragment for libiberty. - -Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new - -MoveIfChange "{o}"config.new "{o}"config.h - - diff --git a/gnu/egcs/libiberty/mpw-make.sed b/gnu/egcs/libiberty/mpw-make.sed deleted file mode 100644 index 6f2a5e77b2b..00000000000 --- a/gnu/egcs/libiberty/mpw-make.sed +++ /dev/null @@ -1,51 +0,0 @@ -# Sed commands to finish translating libiberty's Unix makefile to MPW syntax. - -# Comment out a useless thing. -/^\.always\./s/^/#/ - -# Replace the auto-generated list with the list of what we know we need. -s/`cat needed-list`/"{o}"alloca.c.o "{o}"bcopy.c.o "{o}"getpagesize.c.o "{o}"insque.c.o "{o}"mpw.c.o "{o}"strcasecmp.c.o "{o}"strdup.c.o "{o}"strncasecmp.c.o/ - -# Paste in some desirable definitions. -# The default rule here completely replaces the tricky stuff in the Unix -# Makefile.in. -/^###$/a\ -\ -HDEFINES = -d NEED_sys_siglist -d NEED_sys_errlist -d NEED_basename -d NEED_strcasecmp -d NEED_strncasecmp\ -INCLUDES = -i : -i {INCDIR}: -i {INCDIR}:mpw: -i ::extra-include: -i "{s}"\ -\ -.c.o \\Option-f .c\ - {CC} @DASH_C_FLAG@ {DepDir}{Default}.c {LIBCFLAGS} {INCLUDES} {HDEFINES} @SEGMENT_FLAG({Default})@ -o {TargDir}{Default}.c.o\ - -# Remove dependency on needed-list, which we don't use. -/DO_ALSO =/s/needed-list// - -/INCDIR=/s/"{srcdir}"{MULTISRCTOP}::/"{topsrcdir}"/ - -# Whack out the COMPILE.c trickiness. -/^COMPILE.c /,/^$/d - -# Remove the multido trickiness from the "all" target. -/^all \\Option-f/,/^$/c\ -all \\Option-f {TARGETLIB}\ - - -# Remove the RULE1/RULE2 crud. -/if \[/,/fi/d -/^RULE1 =/,/RULE2 =/d -/RULE2/s/RULE2/TARGETLIB/ - -# Don't want fdmatch ever. -s/ "{o}"fdmatch.c.o// - -# Fix paths to generated files. -/config.h/s/"{s}"config.h/"{o}"config.h/ - -# Whack out config rebuild rules. -/^"{o}"config.h \\Option-f/,/^$/d - - - - - - diff --git a/gnu/egcs/libiberty/mpw.c b/gnu/egcs/libiberty/mpw.c deleted file mode 100644 index ca3ae412d25..00000000000 --- a/gnu/egcs/libiberty/mpw.c +++ /dev/null @@ -1,1010 +0,0 @@ -/* MPW-Unix compatibility library. - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* This should only be compiled and linked under MPW. */ - -#include "mpw.h" - -#include <stdlib.h> - -#ifndef USE_MW_HEADERS -#include <sys/time.h> -#include <sys/resource.h> -#endif - -#include <Types.h> -#include <Files.h> - -#include <Timer.h> - -/* Initialize to 0 at first, then set to errno_max() later. */ - -int sys_nerr = 0; - -/* Debug flag for pathname hacking. Set this to one and rebuild. */ - -int DebugPI = -1; - -void -mpwify_filename(char *unixname, char *macname) -{ - int i, j; - - /* (should truncate 255 chars from end of name, not beginning) */ - if (strlen (unixname) > 255) - { - fprintf (stderr, "Pathname \"%s\" is too long for Macs, truncating\n", - unixname); - } - j = 0; - /* If you're going to end up with one or more colons in the middle of a - path after an all-Unix relative path is translated, you must add a - colon on the front, so that the first component is not thought to be - a disk name. */ - if (unixname[0] != '/' && ! strchr (unixname, ':') && strchr (unixname, '/')) - { - macname[j++] = ':'; - } - for (i = 0; unixname[i] != '\0' && i < 255; ++i) - { - if (i == 0 && unixname[i] == '/') - { - if (strncmp (unixname, "/tmp/", 5) == 0) - { - /* A temporary name, make a more Mac-flavored tmpname. */ - /* A better choice would be {Boot}Trash:foo, but - that would require being able to identify the - boot disk's and trashcan's name. Another option - would be to have an env var, so user can point it - at a ramdisk. */ - macname[j++] = ':'; - macname[j++] = 't'; - macname[j++] = 'm'; - macname[j++] = 'p'; - macname[j++] = '_'; - i += 4; - } - else - { - /* Don't copy the leading slash. */ - } - } - else if (unixname[i] == ':' && unixname[i+1] == '/') - { - macname[j++] = ':'; - i += 1; - } - else if (unixname[i] == '.' && unixname[i+1] == '/') - { - macname[j++] = ':'; - i += 1; - } - else if (unixname[i] == '.' && unixname[i+1] == '.' && unixname[i+2] == '/') - { - macname[j++] = ':'; - macname[j++] = ':'; - i += 2; - } - else if (unixname[i] == '/') - { - macname[j++] = ':'; - } - else - { - macname[j++] = unixname[i]; - } - } - macname[j] = '\0'; - /* Allow for getting the debug flag from an env var; quite useful. */ - if (DebugPI < 0) - DebugPI = (*(getenv ("DEBUG_PATHNAMES")) == '1' ? 1 : 0); - if (DebugPI) - { - fprintf (stderr, "# Made \"%s\"\n", unixname); - fprintf (stderr, "# into \"%s\"\n", macname); - } -} - -/* MPW-flavored basename finder. */ - -char * -mpw_basename (name) - char *name; -{ - char *base = name; - - while (*name) - { - if (*name++ == ':') - { - base = name; - } - } - return base; -} - -/* Mixed MPW/Unix basename finder. This can be led astray by - filenames with slashes in them and come up with a basename that - either corresponds to no file or (worse) to some other file, so - should only be tried if other methods of finding a file via a - basename have failed. */ - -char * -mpw_mixed_basename (name) - char *name; -{ - char *base = name; - - while (*name) - { - if (*name == '/' || *name == ':') - { - base = name + 1; - } - ++name; - } - return base; -} - -/* This function is fopen() modified to create files that are type TEXT - or 'BIN ', and always of type 'MPS '. */ - -FILE * -mpw_fopen (char *name, char *mode) -{ -#undef fopen - int errnum; - FILE *fp; - char tmpname[256]; - - mpwify_filename (name, tmpname); - PROGRESS (1); - fp = fopen (tmpname, mode); - errnum = errno; - - /* If writing, need to set type and creator usefully. */ - if (strchr (mode, 'w')) - { - char *pname = (char *) malloc (strlen (tmpname) + 2); - OSErr e; - struct FInfo fi; - - pname[0] = strlen (tmpname); - strcpy (pname+1, tmpname); - - e = GetFInfo ((ConstStr255Param) pname, 0, &fi); - /* should do spiffier error handling */ - if (e != 0) - fprintf(stderr, "GetFInfo returns %d\n", e); - if (strchr (mode, 'b')) - { - fi.fdType = (OSType) 'BIN '; - } - else - { - fi.fdType = (OSType) 'TEXT'; - } - fi.fdCreator = (OSType) 'MPS '; - e = SetFInfo ((ConstStr255Param) pname, 0, &fi); - if (e != 0) - fprintf(stderr, "SetFInfo returns %d\n", e); - free (pname); - } - if (fp == NULL) - errno = errnum; - return fp; -} - -/* This is a version of fseek() modified to fill the file with zeros - if seeking past the end of it. */ - -#define ZEROBLKSIZE 4096 - -char zeros[ZEROBLKSIZE]; - -int -mpw_fseek (FILE *fp, int offset, int whence) -{ -#undef fseek - int cursize, numleft; - - PROGRESS (1); - if (whence == SEEK_SET) - { - fseek (fp, 0, SEEK_END); - cursize = ftell (fp); - if (offset > cursize) - { - numleft = offset - cursize; - while (numleft > ZEROBLKSIZE) - { - /* This might fail, should check for that. */ - PROGRESS (1); - fwrite (zeros, 1, ZEROBLKSIZE, fp); - numleft -= ZEROBLKSIZE; - } - PROGRESS (1); - fwrite (zeros, 1, numleft, fp); - fflush (fp); - } - } - return fseek (fp, offset, whence); -} - -int -mpw_fread (char *ptr, int size, int nitems, FILE *stream) -{ -#undef fread - int rslt; - - PROGRESS (1); - rslt = fread (ptr, size, nitems, stream); - PROGRESS (1); - return rslt; -} - -int -mpw_fwrite (char *ptr, int size, int nitems, FILE *stream) -{ -#undef fwrite - int rslt; - - PROGRESS (1); - rslt = fwrite (ptr, size, nitems, stream); - PROGRESS (1); - return rslt; -} - -int -link () -{ - fprintf (stderr, "link not available!\n"); - mpw_abort (); -} - -int -fork () -{ - fprintf (stderr, "fork not available!\n"); - mpw_abort (); -} - -int -vfork () -{ - fprintf (stderr, "vfork not available!\n"); - mpw_abort (); - return (-1); -} - -int -pipe (int *fd) -{ - fprintf (stderr, "pipe not available!\n"); - mpw_abort (); - return (-1); -} - -#ifndef USE_MW_HEADERS -int -execvp (char *file, char **argv) -{ - fprintf (stderr, "execvp not available!\n"); - mpw_abort (); - return (-1); -} - -int -execv (char *path, char **argv) -{ - fprintf (stderr, "execv not available!\n"); - mpw_abort (); - return (-1); -} -#endif - -int -kill (int pid, int sig) -{ - fprintf (stderr, "kill not available!\n"); - mpw_abort (); - return (-1); -} - -int -wait (int *status) -{ - *status = 0; - return 0; -} - -#ifndef USE_MW_HEADERS -int -sleep (int seconds) -{ - unsigned long start_time, now; - - time (&start_time); - - while (1) - { - PROGRESS (1); - time (&now); - if (now > start_time + seconds) - return 0; - } -} -#endif - -void -putenv (char *str) -{ - /* The GCC driver calls this to do things for collect2, but we - don't care about collect2. */ -} - -int -chmod (char *path, int mode) -{ - /* Pretend it was all OK. */ - return 0; -} - -#ifndef USE_MW_HEADERS -int -getuid () -{ - /* One value is as good as another... */ - return 0; -} - -int -getgid () -{ - /* One value is as good as another... */ - return 0; -} -#endif - -/* Instead of coredumping, which is not a normal Mac facility, we - drop into Macsbug. If we then "g" from Macsbug, the program will - exit cleanly. */ - -void -mpw_abort () -{ - /* Make sure no output still buffered up, then zap into MacsBug. */ - fflush(stdout); - fflush(stderr); - printf("## Abort! ##\n"); -#ifdef MPW_SADE - SysError(8005); -#else - Debugger(); -#endif - /* "g" in MacsBug will then cause a regular error exit. */ - exit (1); -} - -/* Imitation getrusage based on the ANSI clock() function. */ - -int -getrusage (int who, struct rusage *rusage) -{ - int clk = clock (); - -#if 0 - rusage->ru_utime.tv_sec = clk / CLOCKS_PER_SEC; - rusage->ru_utime.tv_usec = ((clk * 1000) / CLOCKS_PER_SEC) * 1000; - rusage->ru_stime.tv_sec = 0; - rusage->ru_stime.tv_usec = 0; -#endif -} - -int -sbrk () -{ - return 0; -} - -#ifndef USE_MW_HEADERS -int -isatty (int fd) -{ - return 0; -} - -/* This is inherited from Timothy Murray's Posix library. */ - -#include "utime.h" - -int -utime (char *filename, struct utimbuf *times) -{ - CInfoPBRec cipbr; - HFileInfo *fpb = (HFileInfo *) &cipbr; - DirInfo *dpb = (DirInfo *) &cipbr; - unsigned char pname[256]; - short err; - - strcpy ((char *) pname, filename); - c2pstr (pname); - - dpb->ioDrDirID = 0L; - fpb->ioNamePtr = pname; - fpb->ioVRefNum = 0; - fpb->ioFDirIndex = 0; - fpb->ioFVersNum = 0; - err = PBGetCatInfo (&cipbr, 0); - if (err != noErr) { - errno = ENOENT; - return -1; - } - dpb->ioDrDirID = 0L; - fpb->ioFlMdDat = times->modtime; - fpb->ioFlCrDat = times->actime; - err = PBSetCatInfo (&cipbr, 0); - if (err != noErr) { - errno = EACCES; - return -1; - } - return 0; -} - -int -mkdir (char *path, int mode) -{ - errno = ENOSYS; - return -1; -} - -int -rmdir () -{ - errno = ENOSYS; - return -1; -} -#endif - -chown () -{ - errno = ENOSYS; - return -1; -} - -char *myenviron[] = {NULL}; - -char **environ = myenviron; - -#ifndef USE_MW_HEADERS - -/* Minimal 'stat' emulation: tells directories from files and - gives length and mtime. - - Derived from code written by Guido van Rossum, CWI, Amsterdam - and placed by him in the public domain. */ - -extern int __uid, __gid; - -int __uid = 0; -int __gid = 0; - -/* Bits in ioFlAttrib: */ -#define LOCKBIT (1<<0) /* File locked */ -#define DIRBIT (1<<4) /* It's a directory */ - -/* Macified "stat" in which filename is given relative to a directory, - specified by long DirID. */ - -static int -_stat (char *name, long dirid, struct stat *buf) -{ - CInfoPBRec cipbr; - HFileInfo *fpb = (HFileInfo*) &cipbr; - DirInfo *dpb = (DirInfo*) &cipbr; - Str255 pname; - short err; - - /* Make a temp copy of the name and pascalize. */ - strcpy ((char *) pname, name); - c2pstr (pname); - - cipbr.dirInfo.ioDrDirID = dirid; - cipbr.hFileInfo.ioNamePtr = pname; - cipbr.hFileInfo.ioVRefNum = 0; - cipbr.hFileInfo.ioFDirIndex = 0; - cipbr.hFileInfo.ioFVersNum = 0; - err = PBGetCatInfo (&cipbr, 0); - if (err != noErr) - { - errno = ENOENT; - return -1; - } - /* Mac files are readable if they can be accessed at all. */ - buf->st_mode = 0444; - /* Mark unlocked files as writeable. */ - if (!(fpb->ioFlAttrib & LOCKBIT)) - buf->st_mode |= 0222; - if (fpb->ioFlAttrib & DIRBIT) - { - /* Mark directories as "executable". */ - buf->st_mode |= 0111 | S_IFDIR; - buf->st_size = dpb->ioDrNmFls; - buf->st_rsize = 0; - } - else - { - buf->st_mode |= S_IFREG; - /* Mark apps as "executable". */ - if (fpb->ioFlFndrInfo.fdType == 'APPL') - buf->st_mode |= 0111; - /* Fill in the sizes of data and resource forks. */ - buf->st_size = fpb->ioFlLgLen; - buf->st_rsize = fpb->ioFlRLgLen; - } - /* Fill in various times. */ - buf->st_atime = fpb->ioFlCrDat; - buf->st_mtime = fpb->ioFlMdDat; - buf->st_ctime = fpb->ioFlCrDat; - /* Set up an imitation inode number. */ - buf->st_ino = (unsigned short) fpb->ioDirID; - /* Set up an imitation device. */ - GetVRefNum (buf->st_ino, &buf->st_dev); - buf->st_uid = __uid; - buf->st_gid = __gid; -/* buf->st_FlFndrInfo = fpb->ioFlFndrInfo; */ - return 0; -} - -/* stat() sets up an empty dirid. */ - -int -stat (char *path, struct stat *buf) -{ - long rslt, errnum; - char tmpname[256]; - - mpwify_filename (path, tmpname); - if (DebugPI) - fprintf (stderr, "# stat (%s, %x)", tmpname, buf); - PROGRESS (1); - rslt = _stat (tmpname, 0L, buf); - errnum = errno; - if (DebugPI) - { - fprintf (stderr, " -> %d", rslt); - if (rslt != 0) - fprintf (stderr, " (errno is %d)", errnum); - fprintf (stderr, "\n"); - fflush (stderr); - } - if (rslt != 0) - errno = errnum; - return rslt; -} - -int -fstat (int fd, struct stat *buf) -{ - FCBPBRec fcb; - FILE *fp; - Str255 pathname; - long dirid = 0L, temp; - long rslt, errnum; - short err; - - if (DebugPI < 0) - DebugPI = (*(getenv ("DEBUG_PATHNAMES")) == '1' ? 1 : 0); - if (DebugPI) - fprintf (stderr, "# fstat (%d, %x)", fd, buf); - PROGRESS (1); - pathname[0] = 0; -#ifdef FIOFNAME - /* Use an MPW-specific ioctl to get the pathname associated with - the file descriptor. */ - ioctl (fd, FIOFNAME, (long *) pathname); -#else - you lose -#endif - if (DebugPI) - fprintf (stderr, " (name is %s)", pathname); - dirid = 0L /* fcb.ioFCBParID */ ; - rslt = _stat ((char *) pathname, dirid, buf); - errnum = errno; - if (DebugPI) - { - fprintf (stderr, " -> %d", rslt); - if (rslt != 0) - fprintf (stderr, " (errno is %d)", errnum); - fprintf (stderr, "\n"); - fflush (stderr); - } - if (rslt != 0) - errno = errnum; - return rslt; -} - -#endif /* n USE_MW_HEADERS */ - -chdir () -{ - errno = ENOSYS; - return (-1); -} - -char * -getcwd (char *buf, int size) -{ - if (buf == NULL) - buf = (char *) malloc (size); - strcpy(buf, ":"); - return buf; -} - -/* This should probably be more elaborate for MPW. */ - -char * -getpwd () -{ - return ":"; -} - -int -mpw_open (char *filename, int arg2, int arg3) -{ -#undef open - int fd, errnum = 0; - char tmpname[256]; - - mpwify_filename (filename, tmpname); - fd = open (tmpname, arg2); - errnum = errno; - - if (DebugPI) - { - fprintf (stderr, "# open (%s, %d, %d)", tmpname, arg2, arg3); - fprintf (stderr, " -> %d", fd); - if (fd == -1) - fprintf (stderr, " (errno is %d)", errnum); - fprintf (stderr, "\n"); - } - if (fd == -1) - errno = errnum; - return fd; -} - -int -mpw_access (char *filename, unsigned int cmd) -{ -#undef access - - int rslt, errnum = 0; - struct stat st; - char tmpname[256]; - - mpwify_filename (filename, tmpname); - if (cmd & R_OK || cmd & X_OK) - { - rslt = stat (tmpname, &st); - errnum = errno; - if (rslt >= 0) - { - if ((((st.st_mode & 004) == 0) && (cmd & R_OK)) - || (((st.st_mode & 002) == 0) && (cmd & W_OK)) - || (((st.st_mode & 001) == 0) && (cmd & X_OK))) - { - rslt = -1; - errnum = EACCES; - } - } - } - if (DebugPI) - { - fprintf (stderr, "# mpw_access (%s, %d)", tmpname, cmd); - fprintf (stderr, " -> %d", rslt); - if (rslt != 0) - fprintf (stderr, " (errno is %d)", errnum); - fprintf (stderr, "\n"); - } - if (rslt != 0) - errno = errnum; - return rslt; -} - -/* The MPW library creat() has no mode argument. */ - -int -mpw_creat (char *path, /* mode_t */ int mode) -{ -#undef creat - -#ifdef USE_MW_HEADERS - return creat (path, mode); -#else - return creat (path); -#endif -} - -/* This is a hack to get control in an MPW tool before it crashes the - machine. */ - -mpw_special_init (name) - char *name; -{ - if (strstr (name, "DEBUG")) - DebugStr("\pat beginning of program"); -} - -static int current_umask; - -int -umask(int mask) -{ - int oldmask = current_umask; - - current_umask = mask; - return oldmask; -} - -/* Cursor-spinning stuff that includes metering of spin rate and delays. */ - -/* Nonzero when cursor spinning has been set up properly. */ - -int cursor_inited; - -/* Nonzero if spin should be measured and excessive delays reported. */ - -int measure_spin; - -/* Nonzero if spin histogram and rate data should be written out. */ - -int dump_spin_data; - -long warning_threshold = 400000; - -long bucket_size = 1024; - -long bucket_power = 10; - -long numbuckets = 300; - -int *delay_counts; - -int overflow_count; - -char *current_progress; - -static UnsignedWide last_microseconds; - -static char *last_spin_file = ""; - -static int last_spin_line; - -void -warn_if_spin_delay (char *file, int line) -{ - long diff, ix; - UnsignedWide now; - - Microseconds(&now); - - diff = now.lo - last_microseconds.lo; - - if (diff > warning_threshold) - fprintf (stderr, "# %s: %ld.%06ld sec delay getting from %s:%d to %s:%d\n", - (current_progress ? current_progress : ""), - diff / 1000000, diff % 1000000, - last_spin_file, last_spin_line, file, line); - if (dump_spin_data) - { - if (diff >= 0) - { - ix = diff >> bucket_power; - if (ix >= 0 && ix < numbuckets && delay_counts != NULL) - ++delay_counts[ix]; - else - ++overflow_count; - } - else - fprintf (stderr, "raw diff is %ld (?)\n", diff); - } -} - -void -record_for_spin_delay (char *file, int line) -{ - Microseconds (&last_microseconds); - last_spin_file = file; - last_spin_line = line; -} - -void -mpw_start_progress (char *str, int n, char *file, int line) -{ - int i; - char *measure, *threshold; - - if (!cursor_inited) - { - InitCursorCtl (nil); - cursor_inited = 1; - record_for_spin_delay (file, line); - measure = getenv ("MEASURE_SPIN"); - if (measure != NULL && measure[0] != '\0') - { - measure_spin = 1; - if (strcmp (measure, "all") == 0) - dump_spin_data = 1; - } - threshold = getenv ("SPIN_WARN_THRESHOLD"); - if (threshold != NULL && threshold[0] != '\0') - warning_threshold = atol (threshold); - if (dump_spin_data) - { - if (delay_counts == NULL) - delay_counts = (int *) malloc (numbuckets * sizeof (int)); - for (i = 0; i < numbuckets; ++i) - delay_counts[i] = 0; - overflow_count = 0; - } - } - current_progress = str; - - sys_nerr = errno_max (); - - mpw_special_init (str); -} - -void -mpw_progress (int n) -{ - SpinCursor (32); -} - -void -mpw_progress_measured (int n, char *file, int line) -{ - if (measure_spin) - warn_if_spin_delay (file, line); - SpinCursor (32); - if (measure_spin) - record_for_spin_delay (file, line); -} - -void -mpw_end_progress (char *str, char *file, int line) -{ - long i, delay, count = 0, sum = 0, avgdelay, spinrate; - long curpower = 0, curgroup = 0; - - /* Warn if it's been a while since the last spin. */ - if (measure_spin) - warn_if_spin_delay (file, line); - - /* Dump all the nonzero delay counts and an approximation of the delay. */ - if (dump_spin_data && delay_counts != NULL) - { - for (i = 0; i < numbuckets; ++i) - { - delay = (i + 1) * bucket_size; - sum += delay_counts[i] * (i + 1); - count += delay_counts[i]; - if (delay <= (1 << curpower)) - { - curgroup += delay_counts[i]; - } - else - { - if (curgroup > 0) - fprintf (stderr, - "# %s: %d delays between %ld.%06ld and %ld.%06ld sec\n", - (str ? str : ""), - curgroup, - (1 << curpower) / 1000000, - (1 << curpower) % 1000000, - (1 << (curpower + 1)) / 1000000, - (1 << (curpower + 1)) % 1000000); - ++curpower; - curgroup = 0; - } - } - if (count > 0) - { - avgdelay = (sum * bucket_size) / count; - spinrate = 1000000 / avgdelay; - fprintf (stderr, "# %s: Average spin rate is %d times/sec\n", - (str ? str : ""), spinrate); - } - } -} - -#ifdef PROGRESS_TEST - -/* Test program. */ - -main () -{ - int i, j; - double x = 1.0, y = 2.4; - long start = Microseconds (), tm; FIXME - - START_PROGRESS ("hi", 0); - - for (i = 0; i < 1000; ++i) - { - PROGRESS (1); - - for (j = 0; j < (i * 100); ++j) - { - x += (x * y) / j; - } - } - - END_PROGRESS ("hi"); - - tm = Microseconds () - start; - - printf ("Total time is %d.%d secs\n", tm / 1000000, tm % 1000000); -} - -#endif - -#ifdef USE_MW_HEADERS -/* Empty definitions for Metrowerks' SIOUX console library. */ - -#ifndef __CONSOLE__ -#include <console.h> -#endif - -short -InstallConsole(short fd) -{ -#pragma unused (fd) - return 0; -} - -void -RemoveConsole(void) -{ -} - -long -WriteCharsToConsole(char *buf, long n) -{ -#pragma unused (buf, n) - return 0; -} - -long ReadCharsFromConsole(char *buf, long n) -{ -#pragma unused (buf, n) - return 0; -} - -extern char * -__ttyname(long fd) -{ - static char *__devicename = "null device"; - - if (fd >= 0 && fd <= 2) - return (__devicename); - return NULL; -} - -#endif diff --git a/gnu/egcs/libiberty/msdos.c b/gnu/egcs/libiberty/msdos.c deleted file mode 100644 index 923e64d4ede..00000000000 --- a/gnu/egcs/libiberty/msdos.c +++ /dev/null @@ -1,15 +0,0 @@ -char msg[] = "No vfork available - aborting\n"; -vfork() -{ - write(1, msg, sizeof(msg)); -} - -sigsetmask() -{ - /* no signals support in go32 (yet) */ -} - -waitpid() -{ - return -1; -} diff --git a/gnu/egcs/libiberty/objalloc.c b/gnu/egcs/libiberty/objalloc.c deleted file mode 100644 index 57754a86105..00000000000 --- a/gnu/egcs/libiberty/objalloc.c +++ /dev/null @@ -1,291 +0,0 @@ -/* objalloc.c -- routines to allocate memory for objects - Copyright 1997 Free Software Foundation, Inc. - Written by Ian Lance Taylor, Cygnus Solutions. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "ansidecl.h" -#include "objalloc.h" - -/* Get a definition for NULL. */ -#include <stdio.h> - -#if VMS -#include <stdlib.h> -#include <unixlib.h> -#else - -#ifdef ANSI_PROTOTYPES -/* Get a definition for size_t. */ -#include <stddef.h> -#endif - -/* For systems with larger pointers than ints, this must be declared. */ -extern PTR malloc PARAMS ((size_t)); -extern void free PARAMS ((PTR)); -#endif - -/* These routines allocate space for an object. Freeing allocated - space may or may not free all more recently allocated space. - - We handle large and small allocation requests differently. If we - don't have enough space in the current block, and the allocation - request is for more than 512 bytes, we simply pass it through to - malloc. */ - -/* The objalloc structure is defined in objalloc.h. */ - -/* This structure appears at the start of each chunk. */ - -struct objalloc_chunk -{ - /* Next chunk. */ - struct objalloc_chunk *next; - /* If this chunk contains large objects, this is the value of - current_ptr when this chunk was allocated. If this chunk - contains small objects, this is NULL. */ - char *current_ptr; -}; - -/* The aligned size of objalloc_chunk. */ - -#define CHUNK_HEADER_SIZE \ - ((sizeof (struct objalloc_chunk) + OBJALLOC_ALIGN - 1) \ - &~ (OBJALLOC_ALIGN - 1)) - -/* We ask for this much memory each time we create a chunk which is to - hold small objects. */ - -#define CHUNK_SIZE (4096 - 32) - -/* A request for this amount or more is just passed through to malloc. */ - -#define BIG_REQUEST (512) - -/* Create an objalloc structure. */ - -struct objalloc * -objalloc_create () -{ - struct objalloc *ret; - struct objalloc_chunk *chunk; - - ret = (struct objalloc *) malloc (sizeof *ret); - if (ret == NULL) - return NULL; - - ret->chunks = (PTR) malloc (CHUNK_SIZE); - if (ret->chunks == NULL) - { - free (ret); - return NULL; - } - - chunk = (struct objalloc_chunk *) ret->chunks; - chunk->next = NULL; - chunk->current_ptr = NULL; - - ret->current_ptr = (char *) chunk + CHUNK_HEADER_SIZE; - ret->current_space = CHUNK_SIZE - CHUNK_HEADER_SIZE; - - return ret; -} - -/* Allocate space from an objalloc structure. */ - -PTR -_objalloc_alloc (o, len) - struct objalloc *o; - unsigned long len; -{ - /* We avoid confusion from zero sized objects by always allocating - at least 1 byte. */ - if (len == 0) - len = 1; - - len = (len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); - - if (len <= o->current_space) - { - o->current_ptr += len; - o->current_space -= len; - return (PTR) (o->current_ptr - len); - } - - if (len >= BIG_REQUEST) - { - char *ret; - struct objalloc_chunk *chunk; - - ret = (char *) malloc (CHUNK_HEADER_SIZE + len); - if (ret == NULL) - return NULL; - - chunk = (struct objalloc_chunk *) ret; - chunk->next = (struct objalloc_chunk *) o->chunks; - chunk->current_ptr = o->current_ptr; - - o->chunks = (PTR) chunk; - - return (PTR) (ret + CHUNK_HEADER_SIZE); - } - else - { - struct objalloc_chunk *chunk; - - chunk = (struct objalloc_chunk *) malloc (CHUNK_SIZE); - if (chunk == NULL) - return NULL; - chunk->next = (struct objalloc_chunk *) o->chunks; - chunk->current_ptr = NULL; - - o->current_ptr = (char *) chunk + CHUNK_HEADER_SIZE; - o->current_space = CHUNK_SIZE - CHUNK_HEADER_SIZE; - - o->chunks = (PTR) chunk; - - return objalloc_alloc (o, len); - } -} - -/* Free an entire objalloc structure. */ - -void -objalloc_free (o) - struct objalloc *o; -{ - struct objalloc_chunk *l; - - l = (struct objalloc_chunk *) o->chunks; - while (l != NULL) - { - struct objalloc_chunk *next; - - next = l->next; - free (l); - l = next; - } - - free (o); -} - -/* Free a block from an objalloc structure. This also frees all more - recently allocated blocks. */ - -void -objalloc_free_block (o, block) - struct objalloc *o; - PTR block; -{ - struct objalloc_chunk *p, *small; - char *b = (char *) block; - - /* First set P to the chunk which contains the block we are freeing, - and set Q to the last small object chunk we see before P. */ - small = NULL; - for (p = (struct objalloc_chunk *) o->chunks; p != NULL; p = p->next) - { - if (p->current_ptr == NULL) - { - if (b > (char *) p && b < (char *) p + CHUNK_SIZE) - break; - small = p; - } - else - { - if (b == (char *) p + CHUNK_HEADER_SIZE) - break; - } - } - - /* If we can't find the chunk, the caller has made a mistake. */ - if (p == NULL) - abort (); - - if (p->current_ptr == NULL) - { - struct objalloc_chunk *q; - struct objalloc_chunk *first; - - /* The block is in a chunk containing small objects. We can - free every chunk through SMALL, because they have certainly - been allocated more recently. After SMALL, we will not see - any chunks containing small objects; we can free any big - chunk if the current_ptr is greater than or equal to B. We - can then reset the new current_ptr to B. */ - - first = NULL; - q = (struct objalloc_chunk *) o->chunks; - while (q != p) - { - struct objalloc_chunk *next; - - next = q->next; - if (small != NULL) - { - if (small == q) - small = NULL; - free (q); - } - else if (q->current_ptr > b) - free (q); - else if (first == NULL) - first = q; - - q = next; - } - - if (first == NULL) - first = p; - o->chunks = (PTR) first; - - /* Now start allocating from this small block again. */ - o->current_ptr = b; - o->current_space = ((char *) p + CHUNK_SIZE) - b; - } - else - { - struct objalloc_chunk *q; - char *current_ptr; - - /* This block is in a large chunk by itself. We can free - everything on the list up to and including this block. We - then start allocating from the next chunk containing small - objects, setting current_ptr from the value stored with the - large chunk we are freeing. */ - - current_ptr = p->current_ptr; - p = p->next; - - q = (struct objalloc_chunk *) o->chunks; - while (q != p) - { - struct objalloc_chunk *next; - - next = q->next; - free (q); - q = next; - } - - o->chunks = (PTR) p; - - while (p->current_ptr != NULL) - p = p->next; - - o->current_ptr = current_ptr; - o->current_space = ((char *) p + CHUNK_SIZE) - current_ptr; - } -} diff --git a/gnu/egcs/libiberty/obstack.c b/gnu/egcs/libiberty/obstack.c deleted file mode 100644 index bc318b37790..00000000000 --- a/gnu/egcs/libiberty/obstack.c +++ /dev/null @@ -1,593 +0,0 @@ -/* obstack.c - subroutines used implicitly by object stack macros - Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. - - - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@gnu.org. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "obstack.h" - -/* NOTE BEFORE MODIFYING THIS FILE: This version number must be - incremented whenever callers compiled using an old obstack.h can no - longer properly call the functions in this obstack.c. */ -#define OBSTACK_INTERFACE_VERSION 1 - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself, and the installed library - supports the same library interface we do. This code is part of the GNU - C Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object - files, it is simpler to just do this in the source for each such file. */ - -#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */ -#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 -#include <gnu-versions.h> -#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - - -#ifndef ELIDE_CODE - - -#if defined (__STDC__) && __STDC__ -#define POINTER void * -#else -#define POINTER char * -#endif - -/* Determine default alignment. */ -struct fooalign {char x; double d;}; -#define DEFAULT_ALIGNMENT \ - ((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0)) -/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT. - But in fact it might be less smart and round addresses to as much as - DEFAULT_ROUNDING. So we prepare for it to do that. */ -union fooround {long x; double d;}; -#define DEFAULT_ROUNDING (sizeof (union fooround)) - -/* When we copy a long block of data, this is the unit to do it with. - On some machines, copying successive ints does not work; - in such a case, redefine COPYING_UNIT to `long' (if that works) - or `char' as a last resort. */ -#ifndef COPYING_UNIT -#define COPYING_UNIT int -#endif - - -/* The functions allocating more room by calling `obstack_chunk_alloc' - jump to the handler pointed to by `obstack_alloc_failed_handler'. - This variable by default points to the internal function - `print_and_abort'. */ -#if defined (__STDC__) && __STDC__ -static void print_and_abort (void); -void (*obstack_alloc_failed_handler) (void) = print_and_abort; -#else -static void print_and_abort (); -void (*obstack_alloc_failed_handler) () = print_and_abort; -#endif - -/* Exit value used when `print_and_abort' is used. */ -#if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 -#endif -int obstack_exit_failure = EXIT_FAILURE; - -/* The non-GNU-C macros copy the obstack into this global variable - to avoid multiple evaluation. */ - -struct obstack *_obstack; - -/* Define a macro that either calls functions with the traditional malloc/free - calling interface, or calls functions with the mmalloc/mfree interface - (that adds an extra first argument), based on the state of use_extra_arg. - For free, do not use ?:, since some compilers, like the MIPS compilers, - do not allow (expr) ? void : void. */ - -#if defined (__STDC__) && __STDC__ -#define CALL_CHUNKFUN(h, size) \ - (((h) -> use_extra_arg) \ - ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ - : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size))) - -#define CALL_FREEFUN(h, old_chunk) \ - do { \ - if ((h) -> use_extra_arg) \ - (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ - else \ - (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \ - } while (0) -#else -#define CALL_CHUNKFUN(h, size) \ - (((h) -> use_extra_arg) \ - ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ - : (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size))) - -#define CALL_FREEFUN(h, old_chunk) \ - do { \ - if ((h) -> use_extra_arg) \ - (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ - else \ - (*(void (*) ()) (h)->freefun) ((old_chunk)); \ - } while (0) -#endif - - -/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). - Objects start on multiples of ALIGNMENT (0 means use default). - CHUNKFUN is the function to use to allocate chunks, - and FREEFUN the function to free them. - - Return nonzero if successful, zero if out of memory. - To recover from an out of memory error, - free up some memory, then call this again. */ - -int -_obstack_begin (h, size, alignment, chunkfun, freefun) - struct obstack *h; - int size; - int alignment; -#if defined (__STDC__) && __STDC__ - POINTER (*chunkfun) (long); - void (*freefun) (void *); -#else - POINTER (*chunkfun) (); - void (*freefun) (); -#endif -{ - register struct _obstack_chunk *chunk; /* points to new chunk */ - - if (alignment == 0) - alignment = (int) DEFAULT_ALIGNMENT; - if (size == 0) - /* Default size is what GNU malloc can fit in a 4096-byte block. */ - { - /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. - Use the values for range checking, because if range checking is off, - the extra bytes won't be missed terribly, but if range checking is on - and we used a larger request, a whole extra 4096 bytes would be - allocated. - - These number are irrelevant to the new GNU malloc. I suspect it is - less sensitive to the size of the request. */ - int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) - + 4 + DEFAULT_ROUNDING - 1) - & ~(DEFAULT_ROUNDING - 1)); - size = 4096 - extra; - } - -#if defined (__STDC__) && __STDC__ - h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun; - h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; -#else - h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; - h->freefun = freefun; -#endif - h->chunk_size = size; - h->alignment_mask = alignment - 1; - h->use_extra_arg = 0; - - chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); - if (!chunk) - (*obstack_alloc_failed_handler) (); - h->next_free = h->object_base = chunk->contents; - h->chunk_limit = chunk->limit - = (char *) chunk + h->chunk_size; - chunk->prev = 0; - /* The initial chunk now contains no empty object. */ - h->maybe_empty_object = 0; - h->alloc_failed = 0; - return 1; -} - -int -_obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg) - struct obstack *h; - int size; - int alignment; -#if defined (__STDC__) && __STDC__ - POINTER (*chunkfun) (POINTER, long); - void (*freefun) (POINTER, POINTER); -#else - POINTER (*chunkfun) (); - void (*freefun) (); -#endif - POINTER arg; -{ - register struct _obstack_chunk *chunk; /* points to new chunk */ - - if (alignment == 0) - alignment = (int) DEFAULT_ALIGNMENT; - if (size == 0) - /* Default size is what GNU malloc can fit in a 4096-byte block. */ - { - /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. - Use the values for range checking, because if range checking is off, - the extra bytes won't be missed terribly, but if range checking is on - and we used a larger request, a whole extra 4096 bytes would be - allocated. - - These number are irrelevant to the new GNU malloc. I suspect it is - less sensitive to the size of the request. */ - int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) - + 4 + DEFAULT_ROUNDING - 1) - & ~(DEFAULT_ROUNDING - 1)); - size = 4096 - extra; - } - -#if defined(__STDC__) && __STDC__ - h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun; - h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; -#else - h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; - h->freefun = freefun; -#endif - h->chunk_size = size; - h->alignment_mask = alignment - 1; - h->extra_arg = arg; - h->use_extra_arg = 1; - - chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); - if (!chunk) - (*obstack_alloc_failed_handler) (); - h->next_free = h->object_base = chunk->contents; - h->chunk_limit = chunk->limit - = (char *) chunk + h->chunk_size; - chunk->prev = 0; - /* The initial chunk now contains no empty object. */ - h->maybe_empty_object = 0; - h->alloc_failed = 0; - return 1; -} - -/* Allocate a new current chunk for the obstack *H - on the assumption that LENGTH bytes need to be added - to the current object, or a new object of length LENGTH allocated. - Copies any partial object from the end of the old chunk - to the beginning of the new one. */ - -void -_obstack_newchunk (h, length) - struct obstack *h; - int length; -{ - register struct _obstack_chunk *old_chunk = h->chunk; - register struct _obstack_chunk *new_chunk; - register long new_size; - register long obj_size = h->next_free - h->object_base; - register long i; - long already; - - /* Compute size for new chunk. */ - new_size = (obj_size + length) + (obj_size >> 3) + 100; - if (new_size < h->chunk_size) - new_size = h->chunk_size; - - /* Allocate and initialize the new chunk. */ - new_chunk = CALL_CHUNKFUN (h, new_size); - if (!new_chunk) - (*obstack_alloc_failed_handler) (); - h->chunk = new_chunk; - new_chunk->prev = old_chunk; - new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size; - - /* Move the existing object to the new chunk. - Word at a time is fast and is safe if the object - is sufficiently aligned. */ - if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT) - { - for (i = obj_size / sizeof (COPYING_UNIT) - 1; - i >= 0; i--) - ((COPYING_UNIT *)new_chunk->contents)[i] - = ((COPYING_UNIT *)h->object_base)[i]; - /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT, - but that can cross a page boundary on a machine - which does not do strict alignment for COPYING_UNITS. */ - already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT); - } - else - already = 0; - /* Copy remaining bytes one by one. */ - for (i = already; i < obj_size; i++) - new_chunk->contents[i] = h->object_base[i]; - - /* If the object just copied was the only data in OLD_CHUNK, - free that chunk and remove it from the chain. - But not if that chunk might contain an empty object. */ - if (h->object_base == old_chunk->contents && ! h->maybe_empty_object) - { - new_chunk->prev = old_chunk->prev; - CALL_FREEFUN (h, old_chunk); - } - - h->object_base = new_chunk->contents; - h->next_free = h->object_base + obj_size; - /* The new chunk certainly contains no empty object yet. */ - h->maybe_empty_object = 0; -} - -/* Return nonzero if object OBJ has been allocated from obstack H. - This is here for debugging. - If you use it in a program, you are probably losing. */ - -#if defined (__STDC__) && __STDC__ -/* Suppress -Wmissing-prototypes warning. We don't want to declare this in - obstack.h because it is just for debugging. */ -int _obstack_allocated_p (struct obstack *h, POINTER obj); -#endif - -int -_obstack_allocated_p (h, obj) - struct obstack *h; - POINTER obj; -{ - register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ - register struct _obstack_chunk *plp; /* point to previous chunk if any */ - - lp = (h)->chunk; - /* We use >= rather than > since the object cannot be exactly at - the beginning of the chunk but might be an empty object exactly - at the end of an adjacent chunk. */ - while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj)) - { - plp = lp->prev; - lp = plp; - } - return lp != 0; -} - -/* Free objects in obstack H, including OBJ and everything allocate - more recently than OBJ. If OBJ is zero, free everything in H. */ - -#undef obstack_free - -/* This function has two names with identical definitions. - This is the first one, called from non-ANSI code. */ - -void -_obstack_free (h, obj) - struct obstack *h; - POINTER obj; -{ - register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ - register struct _obstack_chunk *plp; /* point to previous chunk if any */ - - lp = h->chunk; - /* We use >= because there cannot be an object at the beginning of a chunk. - But there can be an empty object at that address - at the end of another chunk. */ - while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj)) - { - plp = lp->prev; - CALL_FREEFUN (h, lp); - lp = plp; - /* If we switch chunks, we can't tell whether the new current - chunk contains an empty object, so assume that it may. */ - h->maybe_empty_object = 1; - } - if (lp) - { - h->object_base = h->next_free = (char *) (obj); - h->chunk_limit = lp->limit; - h->chunk = lp; - } - else if (obj != 0) - /* obj is not in any of the chunks! */ - abort (); -} - -/* This function is used from ANSI code. */ - -void -obstack_free (h, obj) - struct obstack *h; - POINTER obj; -{ - register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ - register struct _obstack_chunk *plp; /* point to previous chunk if any */ - - lp = h->chunk; - /* We use >= because there cannot be an object at the beginning of a chunk. - But there can be an empty object at that address - at the end of another chunk. */ - while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj)) - { - plp = lp->prev; - CALL_FREEFUN (h, lp); - lp = plp; - /* If we switch chunks, we can't tell whether the new current - chunk contains an empty object, so assume that it may. */ - h->maybe_empty_object = 1; - } - if (lp) - { - h->object_base = h->next_free = (char *) (obj); - h->chunk_limit = lp->limit; - h->chunk = lp; - } - else if (obj != 0) - /* obj is not in any of the chunks! */ - abort (); -} - -int -_obstack_memory_used (h) - struct obstack *h; -{ - register struct _obstack_chunk* lp; - register int nbytes = 0; - - for (lp = h->chunk; lp != 0; lp = lp->prev) - { - nbytes += lp->limit - (char *) lp; - } - return nbytes; -} - -/* Define the error handler. */ -#ifndef _ -# ifdef HAVE_LIBINTL_H -# include <libintl.h> -# ifndef _ -# define _(Str) gettext (Str) -# endif -# else -# define _(Str) (Str) -# endif -#endif - -static void -print_and_abort () -{ - fputs (_("memory exhausted\n"), stderr); - exit (obstack_exit_failure); -} - -#if 0 -/* These are now turned off because the applications do not use it - and it uses bcopy via obstack_grow, which causes trouble on sysV. */ - -/* Now define the functional versions of the obstack macros. - Define them to simply use the corresponding macros to do the job. */ - -#if defined (__STDC__) && __STDC__ -/* These function definitions do not work with non-ANSI preprocessors; - they won't pass through the macro names in parentheses. */ - -/* The function names appear in parentheses in order to prevent - the macro-definitions of the names from being expanded there. */ - -POINTER (obstack_base) (obstack) - struct obstack *obstack; -{ - return obstack_base (obstack); -} - -POINTER (obstack_next_free) (obstack) - struct obstack *obstack; -{ - return obstack_next_free (obstack); -} - -int (obstack_object_size) (obstack) - struct obstack *obstack; -{ - return obstack_object_size (obstack); -} - -int (obstack_room) (obstack) - struct obstack *obstack; -{ - return obstack_room (obstack); -} - -int (obstack_make_room) (obstack, length) - struct obstack *obstack; - int length; -{ - return obstack_make_room (obstack, length); -} - -void (obstack_grow) (obstack, pointer, length) - struct obstack *obstack; - POINTER pointer; - int length; -{ - obstack_grow (obstack, pointer, length); -} - -void (obstack_grow0) (obstack, pointer, length) - struct obstack *obstack; - POINTER pointer; - int length; -{ - obstack_grow0 (obstack, pointer, length); -} - -void (obstack_1grow) (obstack, character) - struct obstack *obstack; - int character; -{ - obstack_1grow (obstack, character); -} - -void (obstack_blank) (obstack, length) - struct obstack *obstack; - int length; -{ - obstack_blank (obstack, length); -} - -void (obstack_1grow_fast) (obstack, character) - struct obstack *obstack; - int character; -{ - obstack_1grow_fast (obstack, character); -} - -void (obstack_blank_fast) (obstack, length) - struct obstack *obstack; - int length; -{ - obstack_blank_fast (obstack, length); -} - -POINTER (obstack_finish) (obstack) - struct obstack *obstack; -{ - return obstack_finish (obstack); -} - -POINTER (obstack_alloc) (obstack, length) - struct obstack *obstack; - int length; -{ - return obstack_alloc (obstack, length); -} - -POINTER (obstack_copy) (obstack, pointer, length) - struct obstack *obstack; - POINTER pointer; - int length; -{ - return obstack_copy (obstack, pointer, length); -} - -POINTER (obstack_copy0) (obstack, pointer, length) - struct obstack *obstack; - POINTER pointer; - int length; -{ - return obstack_copy0 (obstack, pointer, length); -} - -#endif /* __STDC__ */ - -#endif /* 0 */ - -#endif /* !ELIDE_CODE */ diff --git a/gnu/egcs/libiberty/partition.c b/gnu/egcs/libiberty/partition.c deleted file mode 100644 index c1d584774bf..00000000000 --- a/gnu/egcs/libiberty/partition.c +++ /dev/null @@ -1,185 +0,0 @@ -/* List implentation of a partition of consecutive integers. - Copyright (C) 2000 Free Software Foundation, Inc. - Contributed by CodeSourcery, LLC. - - This file is part of GNU CC. - - GNU CC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GNU CC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNU CC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#include "libiberty.h" -#include "partition.h" - -/* Creates a partition of NUM_ELEMENTS elements. Initially each - element is in a class by itself. */ - -partition -partition_new (num_elements) - int num_elements; -{ - int e; - - partition part = (partition) - xmalloc (sizeof (struct partition_def) + - (num_elements - 1) * sizeof (struct partition_elem)); - part->num_elements = num_elements; - for (e = 0; e < num_elements; ++e) - { - part->elements[e].class_element = e; - part->elements[e].next = &(part->elements[e]); - part->elements[e].class_count = 1; - } - - return part; -} - -/* Freeds a partition. */ - -void -partition_delete (part) - partition part; -{ - free (part); -} - -/* Unites the classes containing ELEM1 and ELEM2 into a single class - of partition PART. If ELEM1 and ELEM2 are already in the same - class, does nothing. Returns the canonical element of the - resulting union class. */ - -int -partition_union (part, elem1, elem2) - partition part; - int elem1; - int elem2; -{ - struct partition_elem *elements = part->elements; - struct partition_elem *e1; - struct partition_elem *e2; - struct partition_elem *p; - struct partition_elem *old_next; - /* The canonical element of the resulting union class. */ - int class_element = elements[elem1].class_element; - - /* If they're already in the same class, do nothing. */ - if (class_element == elements[elem2].class_element) - return class_element; - - /* Make sure ELEM1 is in the larger class of the two. If not, swap - them. This way we always scan the shorter list. */ - if (elements[elem1].class_count < elements[elem2].class_count) - { - int temp = elem1; - elem1 = elem2; - elem2 = temp; - class_element = elements[elem1].class_element; - } - - e1 = &(elements[elem1]); - e2 = &(elements[elem2]); - - /* Keep a count of the number of elements in the list. */ - elements[class_element].class_count - += elements[e2->class_element].class_count; - - /* Update the class fields in elem2's class list. */ - e2->class_element = class_element; - for (p = e2->next; p != e2; p = p->next) - p->class_element = class_element; - - /* Splice ELEM2's class list into ELEM1's. These are circular - lists. */ - old_next = e1->next; - e1->next = e2->next; - e2->next = old_next; - - return class_element; -} - -/* Compare elements ELEM1 and ELEM2 from array of integers, given a - pointer to each. Used to qsort such an array. */ - -static int -elem_compare (elem1, elem2) - const void *elem1; - const void *elem2; -{ - int e1 = * (int *) elem1; - int e2 = * (int *) elem2; - if (e1 < e2) - return -1; - else if (e1 > e2) - return 1; - else - return 0; -} - -/* Prints PART to the file pointer FP. The elements of each - class are sorted. */ - -void -partition_print (part, fp) - partition part; - FILE *fp; -{ - char *done; - int num_elements = part->num_elements; - struct partition_elem *elements = part->elements; - int *class_elements; - int e; - - /* Flag the elements we've already printed. */ - done = (char *) xmalloc (num_elements); - memset (done, 0, num_elements); - - /* A buffer used to sort elements in a class. */ - class_elements = (int *) xmalloc (num_elements * sizeof (int)); - - fputc ('[', fp); - for (e = 0; e < num_elements; ++e) - /* If we haven't printed this element, print its entire class. */ - if (! done[e]) - { - int c = e; - int count = elements[elements[e].class_element].class_count; - int i; - - /* Collect the elements in this class. */ - for (i = 0; i < count; ++i) { - class_elements[i] = c; - done[c] = 1; - c = elements[c].next - elements; - } - /* Sort them. */ - qsort ((void *) class_elements, count, sizeof (int), &elem_compare); - /* Print them. */ - fputc ('(', fp); - for (i = 0; i < count; ++i) - fprintf (fp, i == 0 ? "%d" : " %d", class_elements[i]); - fputc (')', fp); - } - fputc (']', fp); - - free (done); -} - diff --git a/gnu/egcs/libiberty/pexecute.c b/gnu/egcs/libiberty/pexecute.c deleted file mode 100644 index 5003f1fe4d5..00000000000 --- a/gnu/egcs/libiberty/pexecute.c +++ /dev/null @@ -1,778 +0,0 @@ -/* Utilities to execute a program in a subprocess (possibly linked by pipes - with other subprocesses), and wait for it. - Copyright (C) 1996-2000 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* This file exports two functions: pexecute and pwait. */ - -/* This file lives in at least two places: libiberty and gcc. - Don't change one without the other. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdio.h> -#include <errno.h> -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#define ISSPACE (x) isspace(x) -#ifdef HAVE_SYS_WAIT_H -#include <sys/wait.h> -#endif - -#ifdef vfork /* Autoconf may define this to fork for us. */ -# define VFORK_STRING "fork" -#else -# define VFORK_STRING "vfork" -#endif -#ifdef HAVE_VFORK_H -#include <vfork.h> -#endif -#ifdef VMS -#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \ - lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1) -#endif /* VMS */ - -#include "libiberty.h" - -/* stdin file number. */ -#define STDIN_FILE_NO 0 - -/* stdout file number. */ -#define STDOUT_FILE_NO 1 - -/* value of `pipe': port index for reading. */ -#define READ_PORT 0 - -/* value of `pipe': port index for writing. */ -#define WRITE_PORT 1 - -static char *install_error_msg = "installation problem, cannot exec `%s'"; - -/* pexecute: execute a program. - - PROGRAM and ARGV are the arguments to execv/execvp. - - THIS_PNAME is name of the calling program (i.e. argv[0]). - - TEMP_BASE is the path name, sans suffix, of a temporary file to use - if needed. This is currently only needed for MSDOS ports that don't use - GO32 (do any still exist?). Ports that don't need it can pass NULL. - - (FLAGS & PEXECUTE_SEARCH) is non-zero if $PATH should be searched - (??? It's not clear that GCC passes this flag correctly). - (FLAGS & PEXECUTE_FIRST) is nonzero for the first process in chain. - (FLAGS & PEXECUTE_FIRST) is nonzero for the last process in chain. - FIRST_LAST could be simplified to only mark the last of a chain of processes - but that requires the caller to always mark the last one (and not give up - early if some error occurs). It's more robust to require the caller to - mark both ends of the chain. - - The result is the pid on systems like Unix where we fork/exec and on systems - like WIN32 and OS2 where we use spawn. It is up to the caller to wait for - the child. - - The result is the WEXITSTATUS on systems like MSDOS where we spawn and wait - for the child here. - - Upon failure, ERRMSG_FMT and ERRMSG_ARG are set to the text of the error - message with an optional argument (if not needed, ERRMSG_ARG is set to - NULL), and -1 is returned. `errno' is available to the caller to use. - - pwait: cover function for wait. - - PID is the process id of the task to wait for. - STATUS is the `status' argument to wait. - FLAGS is currently unused (allows future enhancement without breaking - upward compatibility). Pass 0 for now. - - The result is the pid of the child reaped, - or -1 for failure (errno says why). - - On systems that don't support waiting for a particular child, PID is - ignored. On systems like MSDOS that don't really multitask pwait - is just a mechanism to provide a consistent interface for the caller. - - pfinish: finish generation of script - - pfinish is necessary for systems like MPW where a script is generated that - runs the requested programs. -*/ - -#ifdef __MSDOS__ - -/* MSDOS doesn't multitask, but for the sake of a consistent interface - the code behaves like it does. pexecute runs the program, tucks the - exit code away, and returns a "pid". pwait must be called to fetch the - exit code. */ - -#include <process.h> - -/* For communicating information from pexecute to pwait. */ -static int last_pid = 0; -static int last_status = 0; -static int last_reaped = 0; - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int rc; - - last_pid++; - if (last_pid < 0) - last_pid = 1; - - if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE) - abort (); - -#ifdef __GO32__ - /* ??? What are the possible return values from spawnv? */ - rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv); -#else - char *scmd, *rf; - FILE *argfile; - int i, el = flags & PEXECUTE_SEARCH ? 4 : 0; - - if (temp_base == 0) - temp_base = choose_temp_base (); - scmd = (char *) xmalloc (strlen (program) + strlen (temp_base) + 6 + el); - rf = scmd + strlen(program) + 2 + el; - sprintf (scmd, "%s%s @%s.gp", program, - (flags & PEXECUTE_SEARCH ? ".exe" : ""), temp_base); - argfile = fopen (rf, "w"); - if (argfile == 0) - { - int errno_save = errno; - free (scmd); - errno = errno_save; - *errmsg_fmt = "cannot open `%s.gp'"; - *errmsg_arg = temp_base; - return -1; - } - - for (i=1; argv[i]; i++) - { - char *cp; - for (cp = argv[i]; *cp; cp++) - { - if (*cp == '"' || *cp == '\'' || *cp == '\\' || ISSPACE (*cp)) - fputc ('\\', argfile); - fputc (*cp, argfile); - } - fputc ('\n', argfile); - } - fclose (argfile); - - rc = system (scmd); - - { - int errno_save = errno; - remove (rf); - free (scmd); - errno = errno_save; - } -#endif - - if (rc == -1) - { - *errmsg_fmt = install_error_msg; - *errmsg_arg = program; - return -1; - } - - /* Tuck the status away for pwait, and return a "pid". */ - last_status = rc << 8; - return last_pid; -} - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ - /* On MSDOS each pexecute must be followed by it's associated pwait. */ - if (pid != last_pid - /* Called twice for the same child? */ - || pid == last_reaped) - { - /* ??? ECHILD would be a better choice. Can we use it here? */ - errno = EINVAL; - return -1; - } - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ - *status = last_status; - last_reaped = last_pid; - return last_pid; -} - -#endif /* MSDOS */ - -#if defined (_WIN32) && ! defined (_UWIN) - -#include <process.h> - -#ifdef __CYGWIN__ - -#define fix_argv(argvec) (argvec) - -extern int _spawnv (); -extern int _spawnvp (); - -#else /* ! __CYGWIN__ */ - -/* This is a kludge to get around the Microsoft C spawn functions' propensity - to remove the outermost set of double quotes from all arguments. */ - -const char * const * -fix_argv (argvec) - char **argvec; -{ - int i; - - for (i = 1; argvec[i] != 0; i++) - { - int len, j; - char *temp, *newtemp; - - temp = argvec[i]; - len = strlen (temp); - for (j = 0; j < len; j++) - { - if (temp[j] == '"') - { - newtemp = xmalloc (len + 2); - strncpy (newtemp, temp, j); - newtemp [j] = '\\'; - strncpy (&newtemp [j+1], &temp [j], len-j); - newtemp [len+1] = 0; - temp = newtemp; - len++; - j++; - } - } - - argvec[i] = temp; - } - - for (i = 0; argvec[i] != 0; i++) - { - if (strpbrk (argvec[i], " \t")) - { - int len, trailing_backslash; - char *temp; - - len = strlen (argvec[i]); - trailing_backslash = 0; - - /* There is an added complication when an arg with embedded white - space ends in a backslash (such as in the case of -iprefix arg - passed to cpp). The resulting quoted strings gets misinterpreted - by the command interpreter -- it thinks that the ending quote - is escaped by the trailing backslash and things get confused. - We handle this case by escaping the trailing backslash, provided - it was not escaped in the first place. */ - if (len > 1 - && argvec[i][len-1] == '\\' - && argvec[i][len-2] != '\\') - { - trailing_backslash = 1; - ++len; /* to escape the final backslash. */ - } - - len += 2; /* and for the enclosing quotes. */ - - temp = xmalloc (len + 1); - temp[0] = '"'; - strcpy (temp + 1, argvec[i]); - if (trailing_backslash) - temp[len-2] = '\\'; - temp[len-1] = '"'; - temp[len] = '\0'; - - argvec[i] = temp; - } - } - - return (const char * const *) argvec; -} -#endif /* __CYGWIN__ */ - -#include <io.h> -#include <fcntl.h> -#include <signal.h> - -/* mingw32 headers may not define the following. */ - -#ifndef _P_WAIT -# define _P_WAIT 0 -# define _P_NOWAIT 1 -# define _P_OVERLAY 2 -# define _P_NOWAITO 3 -# define _P_DETACH 4 - -# define WAIT_CHILD 0 -# define WAIT_GRANDCHILD 1 -#endif - -/* Win32 supports pipes */ -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int pid; - int pdes[2], org_stdin, org_stdout; - int input_desc, output_desc; - int retries, sleep_interval; - - /* Pipe waiting from last process, to be used as input for the next one. - Value is STDIN_FILE_NO if no pipe is waiting - (i.e. the next command is the first of a group). */ - static int last_pipe_input; - - /* If this is the first process, initialize. */ - if (flags & PEXECUTE_FIRST) - last_pipe_input = STDIN_FILE_NO; - - input_desc = last_pipe_input; - - /* If this isn't the last process, make a pipe for its output, - and record it as waiting to be the input to the next process. */ - if (! (flags & PEXECUTE_LAST)) - { - if (_pipe (pdes, 256, O_BINARY) < 0) - { - *errmsg_fmt = "pipe"; - *errmsg_arg = NULL; - return -1; - } - output_desc = pdes[WRITE_PORT]; - last_pipe_input = pdes[READ_PORT]; - } - else - { - /* Last process. */ - output_desc = STDOUT_FILE_NO; - last_pipe_input = STDIN_FILE_NO; - } - - if (input_desc != STDIN_FILE_NO) - { - org_stdin = dup (STDIN_FILE_NO); - dup2 (input_desc, STDIN_FILE_NO); - close (input_desc); - } - - if (output_desc != STDOUT_FILE_NO) - { - org_stdout = dup (STDOUT_FILE_NO); - dup2 (output_desc, STDOUT_FILE_NO); - close (output_desc); - } - - pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv) - (_P_NOWAIT, program, fix_argv(argv)); - - if (input_desc != STDIN_FILE_NO) - { - dup2 (org_stdin, STDIN_FILE_NO); - close (org_stdin); - } - - if (output_desc != STDOUT_FILE_NO) - { - dup2 (org_stdout, STDOUT_FILE_NO); - close (org_stdout); - } - - if (pid == -1) - { - *errmsg_fmt = install_error_msg; - *errmsg_arg = program; - return -1; - } - - return pid; -} - -/* MS CRTDLL doesn't return enough information in status to decide if the - child exited due to a signal or not, rather it simply returns an - integer with the exit code of the child; eg., if the child exited with - an abort() call and didn't have a handler for SIGABRT, it simply returns - with status = 3. We fix the status code to conform to the usual WIF* - macros. Note that WIFSIGNALED will never be true under CRTDLL. */ - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ -#ifdef __CYGWIN__ - return wait (status); -#else - int termstat; - - pid = _cwait (&termstat, pid, WAIT_CHILD); - - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ - - /* cwait returns the child process exit code in termstat. - A value of 3 indicates that the child caught a signal, but not - which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we - report SIGABRT. */ - if (termstat == 3) - *status = SIGABRT; - else - *status = (((termstat) & 0xff) << 8); - - return pid; -#endif /* __CYGWIN__ */ -} - -#endif /* _WIN32 && ! _UWIN */ - -#ifdef OS2 - -/* ??? Does OS2 have process.h? */ -extern int spawnv (); -extern int spawnvp (); - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int pid; - - if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE) - abort (); - /* ??? Presumably 1 == _P_NOWAIT. */ - pid = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv); - if (pid == -1) - { - *errmsg_fmt = install_error_msg; - *errmsg_arg = program; - return -1; - } - return pid; -} - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ - int pid = wait (status); - return pid; -} - -#endif /* OS2 */ - -#ifdef MPW - -/* MPW pexecute doesn't actually run anything; instead, it writes out - script commands that, when run, will do the actual executing. - - For example, in GCC's case, GCC will write out several script commands: - - cpp ... - cc1 ... - as ... - ld ... - - and then exit. None of the above programs will have run yet. The task - that called GCC will then execute the script and cause cpp,etc. to run. - The caller must invoke pfinish before calling exit. This adds - the finishing touches to the generated script. */ - -static int first_time = 1; - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - char tmpprogram[255]; - char *cp, *tmpname; - int i; - - mpwify_filename (program, tmpprogram); - if (first_time) - { - printf ("Set Failed 0\n"); - first_time = 0; - } - - fputs ("If {Failed} == 0\n", stdout); - /* If being verbose, output a copy of the command. It should be - accurate enough and escaped enough to be "clickable". */ - if (flags & PEXECUTE_VERBOSE) - { - fputs ("\tEcho ", stdout); - fputc ('\'', stdout); - fputs (tmpprogram, stdout); - fputc ('\'', stdout); - fputc (' ', stdout); - for (i=1; argv[i]; i++) - { - fputc ('\'', stdout); - /* See if we have an argument that needs fixing. */ - if (strchr(argv[i], '/')) - { - tmpname = (char *) xmalloc (256); - mpwify_filename (argv[i], tmpname); - argv[i] = tmpname; - } - for (cp = argv[i]; *cp; cp++) - { - /* Write an Option-d escape char in front of special chars. */ - if (strchr("'+", *cp)) - fputc ('\266', stdout); - fputc (*cp, stdout); - } - fputc ('\'', stdout); - fputc (' ', stdout); - } - fputs ("\n", stdout); - } - fputs ("\t", stdout); - fputs (tmpprogram, stdout); - fputc (' ', stdout); - - for (i=1; argv[i]; i++) - { - /* See if we have an argument that needs fixing. */ - if (strchr(argv[i], '/')) - { - tmpname = (char *) xmalloc (256); - mpwify_filename (argv[i], tmpname); - argv[i] = tmpname; - } - if (strchr (argv[i], ' ')) - fputc ('\'', stdout); - for (cp = argv[i]; *cp; cp++) - { - /* Write an Option-d escape char in front of special chars. */ - if (strchr("'+", *cp)) - fputc ('\266', stdout); - fputc (*cp, stdout); - } - if (strchr (argv[i], ' ')) - fputc ('\'', stdout); - fputc (' ', stdout); - } - - fputs ("\n", stdout); - - /* Output commands that arrange to clean up and exit if a failure occurs. - We have to be careful to collect the status from the program that was - run, rather than some other script command. Also, we don't exit - immediately, since necessary cleanups are at the end of the script. */ - fputs ("\tSet TmpStatus {Status}\n", stdout); - fputs ("\tIf {TmpStatus} != 0\n", stdout); - fputs ("\t\tSet Failed {TmpStatus}\n", stdout); - fputs ("\tEnd\n", stdout); - fputs ("End\n", stdout); - - /* We're just composing a script, can't fail here. */ - return 0; -} - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ - *status = 0; - return 0; -} - -/* Write out commands that will exit with the correct error code - if something in the script failed. */ - -void -pfinish () -{ - printf ("\tExit \"{Failed}\"\n"); -} - -#endif /* MPW */ - -/* include for Unix-like environments but not for Dos-like environments */ -#if ! defined (__MSDOS__) && ! defined (OS2) && ! defined (MPW) \ - && ! (defined (_WIN32) && ! defined (_UWIN)) - -extern int execv (); -extern int execvp (); - -int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) - const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base; - char **errmsg_fmt, **errmsg_arg; - int flags; -{ - int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv); - int pid; - int pdes[2]; - int input_desc, output_desc; - int retries, sleep_interval; - /* Pipe waiting from last process, to be used as input for the next one. - Value is STDIN_FILE_NO if no pipe is waiting - (i.e. the next command is the first of a group). */ - static int last_pipe_input; - - /* If this is the first process, initialize. */ - if (flags & PEXECUTE_FIRST) - last_pipe_input = STDIN_FILE_NO; - - input_desc = last_pipe_input; - - /* If this isn't the last process, make a pipe for its output, - and record it as waiting to be the input to the next process. */ - if (! (flags & PEXECUTE_LAST)) - { - if (pipe (pdes) < 0) - { - *errmsg_fmt = "pipe"; - *errmsg_arg = NULL; - return -1; - } - output_desc = pdes[WRITE_PORT]; - last_pipe_input = pdes[READ_PORT]; - } - else - { - /* Last process. */ - output_desc = STDOUT_FILE_NO; - last_pipe_input = STDIN_FILE_NO; - } - - /* Fork a subprocess; wait and retry if it fails. */ - sleep_interval = 1; - for (retries = 0; retries < 4; retries++) - { - pid = vfork (); - if (pid >= 0) - break; - sleep (sleep_interval); - sleep_interval *= 2; - } - - switch (pid) - { - case -1: - { - *errmsg_fmt = VFORK_STRING; - *errmsg_arg = NULL; - return -1; - } - - case 0: /* child */ - /* Move the input and output pipes into place, if necessary. */ - if (input_desc != STDIN_FILE_NO) - { - close (STDIN_FILE_NO); - dup (input_desc); - close (input_desc); - } - if (output_desc != STDOUT_FILE_NO) - { - close (STDOUT_FILE_NO); - dup (output_desc); - close (output_desc); - } - - /* Close the parent's descs that aren't wanted here. */ - if (last_pipe_input != STDIN_FILE_NO) - close (last_pipe_input); - - /* Exec the program. */ - (*func) (program, argv); - - /* Note: Calling fprintf and exit here doesn't seem right for vfork. */ - fprintf (stderr, "%s: ", this_pname); - fprintf (stderr, install_error_msg, program); - fprintf (stderr, ": %s\n", xstrerror (errno)); - exit (-1); - /* NOTREACHED */ - return 0; - - default: - /* In the parent, after forking. - Close the descriptors that we made for this child. */ - if (input_desc != STDIN_FILE_NO) - close (input_desc); - if (output_desc != STDOUT_FILE_NO) - close (output_desc); - - /* Return child's process number. */ - return pid; - } -} - -int -pwait (pid, status, flags) - int pid; - int *status; - int flags; -{ - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ -#ifdef VMS - pid = waitpid (-1, status, 0); -#else - pid = wait (status); -#endif - return pid; -} - -#endif /* ! __MSDOS__ && ! OS2 && ! MPW && ! (_WIN32 && ! _UWIN) */ diff --git a/gnu/egcs/libiberty/putenv.c b/gnu/egcs/libiberty/putenv.c deleted file mode 100644 index 9d5692222cf..00000000000 --- a/gnu/egcs/libiberty/putenv.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc. - This file based on putenv.c in the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#if defined (_AIX) && !defined (__GNUC__) - #pragma alloca -#endif - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "ansidecl.h" - -#if HAVE_STDLIB_H -# include <stdlib.h> -#endif -#if HAVE_STRING_H -# include <string.h> -#endif - -#ifdef HAVE_ALLOCA_H -# include <alloca.h> -#else -# ifndef alloca -# ifdef __GNUC__ -# define alloca __builtin_alloca -# else -extern char *alloca (); -# endif /* __GNUC__ */ -# endif /* alloca */ -#endif /* HAVE_ALLOCA_H */ - -/* Below this point, it's verbatim code from the glibc-2.0 implementation */ - - -/* Put STRING, which is of the form "NAME=VALUE", in the environment. */ -int -putenv (string) - const char *string; -{ - const char *const name_end = strchr (string, '='); - - if (name_end) - { - char *name = (char *) alloca (name_end - string + 1); - memcpy (name, string, name_end - string); - name[name_end - string] = '\0'; - return setenv (name, name_end + 1, 1); - } - - unsetenv (string); - return 0; -} diff --git a/gnu/egcs/libiberty/random.c b/gnu/egcs/libiberty/random.c deleted file mode 100644 index 0a950709fce..00000000000 --- a/gnu/egcs/libiberty/random.c +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* - * This is derived from the Berkeley source: - * @(#)random.c 5.5 (Berkeley) 7/6/88 - * It was reworked for the GNU C Library by Roland McGrath. - */ - -#include <errno.h> - -#if 0 - -#include <ansidecl.h> -#include <limits.h> -#include <stddef.h> -#include <stdlib.h> - -#else - -#define ULONG_MAX ((unsigned long)(~0L)) /* 0xFFFFFFFF for 32-bits */ -#define LONG_MAX ((long)(ULONG_MAX >> 1)) /* 0x7FFFFFFF for 32-bits*/ - -#ifdef __STDC__ -# define PTR void * -# ifndef NULL -# define NULL (void *) 0 -# endif -#else -# define PTR char * -# ifndef NULL -# define NULL (void *) 0 -# endif -#endif - -#endif - -long int random (); - -/* An improved random number generation package. In addition to the standard - rand()/srand() like interface, this package also has a special state info - interface. The initstate() routine is called with a seed, an array of - bytes, and a count of how many bytes are being passed in; this array is - then initialized to contain information for random number generation with - that much state information. Good sizes for the amount of state - information are 32, 64, 128, and 256 bytes. The state can be switched by - calling the setstate() function with the same array as was initiallized - with initstate(). By default, the package runs with 128 bytes of state - information and generates far better random numbers than a linear - congruential generator. If the amount of state information is less than - 32 bytes, a simple linear congruential R.N.G. is used. Internally, the - state information is treated as an array of longs; the zeroeth element of - the array is the type of R.N.G. being used (small integer); the remainder - of the array is the state information for the R.N.G. Thus, 32 bytes of - state information will give 7 longs worth of state information, which will - allow a degree seven polynomial. (Note: The zeroeth word of state - information also has some other information stored in it; see setstate - for details). The random number generation technique is a linear feedback - shift register approach, employing trinomials (since there are fewer terms - to sum up that way). In this approach, the least significant bit of all - the numbers in the state table will act as a linear feedback shift register, - and will have period 2^deg - 1 (where deg is the degree of the polynomial - being used, assuming that the polynomial is irreducible and primitive). - The higher order bits will have longer periods, since their values are - also influenced by pseudo-random carries out of the lower bits. The - total period of the generator is approximately deg*(2**deg - 1); thus - doubling the amount of state information has a vast influence on the - period of the generator. Note: The deg*(2**deg - 1) is an approximation - only good for large deg, when the period of the shift register is the - dominant factor. With deg equal to seven, the period is actually much - longer than the 7*(2**7 - 1) predicted by this formula. */ - - - -/* For each of the currently supported random number generators, we have a - break value on the amount of state information (you need at least thi - bytes of state info to support this random number generator), a degree for - the polynomial (actually a trinomial) that the R.N.G. is based on, and - separation between the two lower order coefficients of the trinomial. */ - -/* Linear congruential. */ -#define TYPE_0 0 -#define BREAK_0 8 -#define DEG_0 0 -#define SEP_0 0 - -/* x**7 + x**3 + 1. */ -#define TYPE_1 1 -#define BREAK_1 32 -#define DEG_1 7 -#define SEP_1 3 - -/* x**15 + x + 1. */ -#define TYPE_2 2 -#define BREAK_2 64 -#define DEG_2 15 -#define SEP_2 1 - -/* x**31 + x**3 + 1. */ -#define TYPE_3 3 -#define BREAK_3 128 -#define DEG_3 31 -#define SEP_3 3 - -/* x**63 + x + 1. */ -#define TYPE_4 4 -#define BREAK_4 256 -#define DEG_4 63 -#define SEP_4 1 - - -/* Array versions of the above information to make code run faster. - Relies on fact that TYPE_i == i. */ - -#define MAX_TYPES 5 /* Max number of types above. */ - -static int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; -static int seps[MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; - - - -/* Initially, everything is set up as if from: - initstate(1, randtbl, 128); - Note that this initialization takes advantage of the fact that srandom - advances the front and rear pointers 10*rand_deg times, and hence the - rear pointer which starts at 0 will also end up at zero; thus the zeroeth - element of the state information, which contains info about the current - position of the rear pointer is just - (MAX_TYPES * (rptr - state)) + TYPE_3 == TYPE_3. */ - -static long int randtbl[DEG_3 + 1] = - { TYPE_3, - 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, - 0xde3b81e0, 0xdf0a6fb5, 0xf103bc02, 0x48f340fb, - 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd, - 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, - 0xda672e2a, 0x1588ca88, 0xe369735d, 0x904f35f7, - 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc, - 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, - 0xf5ad9d0e, 0x8999220b, 0x27fb47b9 - }; - -/* FPTR and RPTR are two pointers into the state info, a front and a rear - pointer. These two pointers are always rand_sep places aparts, as they - cycle through the state information. (Yes, this does mean we could get - away with just one pointer, but the code for random is more efficient - this way). The pointers are left positioned as they would be from the call: - initstate(1, randtbl, 128); - (The position of the rear pointer, rptr, is really 0 (as explained above - in the initialization of randtbl) because the state table pointer is set - to point to randtbl[1] (as explained below).) */ - -static long int *fptr = &randtbl[SEP_3 + 1]; -static long int *rptr = &randtbl[1]; - - - -/* The following things are the pointer to the state information table, - the type of the current generator, the degree of the current polynomial - being used, and the separation between the two pointers. - Note that for efficiency of random, we remember the first location of - the state information, not the zeroeth. Hence it is valid to access - state[-1], which is used to store the type of the R.N.G. - Also, we remember the last location, since this is more efficient than - indexing every time to find the address of the last element to see if - the front and rear pointers have wrapped. */ - -static long int *state = &randtbl[1]; - -static int rand_type = TYPE_3; -static int rand_deg = DEG_3; -static int rand_sep = SEP_3; - -static long int *end_ptr = &randtbl[sizeof(randtbl) / sizeof(randtbl[0])]; - -/* Initialize the random number generator based on the given seed. If the - type is the trivial no-state-information type, just remember the seed. - Otherwise, initializes state[] based on the given "seed" via a linear - congruential generator. Then, the pointers are set to known locations - that are exactly rand_sep places apart. Lastly, it cycles the state - information a given number of times to get rid of any initial dependencies - introduced by the L.C.R.N.G. Note that the initialization of randtbl[] - for default usage relies on values produced by this routine. */ -void -srandom (x) - unsigned int x; -{ - state[0] = x; - if (rand_type != TYPE_0) - { - register long int i; - for (i = 1; i < rand_deg; ++i) - state[i] = (1103515145 * state[i - 1]) + 12345; - fptr = &state[rand_sep]; - rptr = &state[0]; - for (i = 0; i < 10 * rand_deg; ++i) - random(); - } -} - -/* Initialize the state information in the given array of N bytes for - future random number generation. Based on the number of bytes we - are given, and the break values for the different R.N.G.'s, we choose - the best (largest) one we can and set things up for it. srandom is - then called to initialize the state information. Note that on return - from srandom, we set state[-1] to be the type multiplexed with the current - value of the rear pointer; this is so successive calls to initstate won't - lose this information and will be able to restart with setstate. - Note: The first thing we do is save the current state, if any, just like - setstate so that it doesn't matter when initstate is called. - Returns a pointer to the old state. */ -PTR -initstate (seed, arg_state, n) - unsigned int seed; - PTR arg_state; - unsigned long n; -{ - PTR ostate = (PTR) &state[-1]; - - if (rand_type == TYPE_0) - state[-1] = rand_type; - else - state[-1] = (MAX_TYPES * (rptr - state)) + rand_type; - if (n < BREAK_1) - { - if (n < BREAK_0) - { - errno = EINVAL; - return NULL; - } - rand_type = TYPE_0; - rand_deg = DEG_0; - rand_sep = SEP_0; - } - else if (n < BREAK_2) - { - rand_type = TYPE_1; - rand_deg = DEG_1; - rand_sep = SEP_1; - } - else if (n < BREAK_3) - { - rand_type = TYPE_2; - rand_deg = DEG_2; - rand_sep = SEP_2; - } - else if (n < BREAK_4) - { - rand_type = TYPE_3; - rand_deg = DEG_3; - rand_sep = SEP_3; - } - else - { - rand_type = TYPE_4; - rand_deg = DEG_4; - rand_sep = SEP_4; - } - - state = &((long int *) arg_state)[1]; /* First location. */ - /* Must set END_PTR before srandom. */ - end_ptr = &state[rand_deg]; - srandom(seed); - if (rand_type == TYPE_0) - state[-1] = rand_type; - else - state[-1] = (MAX_TYPES * (rptr - state)) + rand_type; - - return ostate; -} - -/* Restore the state from the given state array. - Note: It is important that we also remember the locations of the pointers - in the current state information, and restore the locations of the pointers - from the old state information. This is done by multiplexing the pointer - location into the zeroeth word of the state information. Note that due - to the order in which things are done, it is OK to call setstate with the - same state as the current state - Returns a pointer to the old state information. */ - -PTR -setstate (arg_state) - PTR arg_state; -{ - register long int *new_state = (long int *) arg_state; - register int type = new_state[0] % MAX_TYPES; - register int rear = new_state[0] / MAX_TYPES; - PTR ostate = (PTR) &state[-1]; - - if (rand_type == TYPE_0) - state[-1] = rand_type; - else - state[-1] = (MAX_TYPES * (rptr - state)) + rand_type; - - switch (type) - { - case TYPE_0: - case TYPE_1: - case TYPE_2: - case TYPE_3: - case TYPE_4: - rand_type = type; - rand_deg = degrees[type]; - rand_sep = seps[type]; - break; - default: - /* State info munged. */ - errno = EINVAL; - return NULL; - } - - state = &new_state[1]; - if (rand_type != TYPE_0) - { - rptr = &state[rear]; - fptr = &state[(rear + rand_sep) % rand_deg]; - } - /* Set end_ptr too. */ - end_ptr = &state[rand_deg]; - - return ostate; -} - -/* If we are using the trivial TYPE_0 R.N.G., just do the old linear - congruential bit. Otherwise, we do our fancy trinomial stuff, which is the - same in all ther other cases due to all the global variables that have been - set up. The basic operation is to add the number at the rear pointer into - the one at the front pointer. Then both pointers are advanced to the next - location cyclically in the table. The value returned is the sum generated, - reduced to 31 bits by throwing away the "least random" low bit. - Note: The code takes advantage of the fact that both the front and - rear pointers can't wrap on the same call by not testing the rear - pointer if the front one has wrapped. Returns a 31-bit random number. */ - -long int -random () -{ - if (rand_type == TYPE_0) - { - state[0] = ((state[0] * 1103515245) + 12345) & LONG_MAX; - return state[0]; - } - else - { - long int i; - *fptr += *rptr; - /* Chucking least random bit. */ - i = (*fptr >> 1) & LONG_MAX; - ++fptr; - if (fptr >= end_ptr) - { - fptr = state; - ++rptr; - } - else - { - ++rptr; - if (rptr >= end_ptr) - rptr = state; - } - return i; - } -} diff --git a/gnu/egcs/libiberty/rename.c b/gnu/egcs/libiberty/rename.c deleted file mode 100644 index ae26e2d0040..00000000000 --- a/gnu/egcs/libiberty/rename.c +++ /dev/null @@ -1,22 +0,0 @@ -/* rename -- rename a file - This function is in the public domain. */ - -/* Rename a file. */ - -#include <errno.h> - -int -rename (zfrom, zto) - char *zfrom; - char *zto; -{ - if (link (zfrom, zto) < 0) - { - if (errno != EEXIST) - return -1; - if (unlink (zto) < 0 - || link (zfrom, zto) < 0) - return -1; - } - return unlink (zfrom); -} diff --git a/gnu/egcs/libiberty/rindex.c b/gnu/egcs/libiberty/rindex.c deleted file mode 100644 index 061d1269f17..00000000000 --- a/gnu/egcs/libiberty/rindex.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Stub implementation of (obsolete) rindex(). */ - -extern char *strrchr (); - -char * -rindex (s, c) - char *s; - int c; -{ - return strrchr (s, c); -} diff --git a/gnu/egcs/libiberty/safe-ctype.c b/gnu/egcs/libiberty/safe-ctype.c deleted file mode 100644 index 0c2be3ed795..00000000000 --- a/gnu/egcs/libiberty/safe-ctype.c +++ /dev/null @@ -1,163 +0,0 @@ -/* <ctype.h> replacement macros. - - Copyright (C) 2000 Free Software Foundation, Inc. - Contributed by Zack Weinberg <zackw@stanford.edu>. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* This is a compatible replacement of the standard C library's <ctype.h> - with the following properties: - - - Implements all isxxx() macros required by C99. - - Also implements some character classes useful when - parsing C-like languages. - - Does not change behavior depending on the current locale. - - Behaves properly for all values in the range of a signed or - unsigned char. */ - -#include "ansidecl.h" -#include <safe-ctype.h> -#include <stdio.h> /* for EOF */ - -/* Shorthand */ -#define bl _sch_isblank -#define cn _sch_iscntrl -#define di _sch_isdigit -#define is _sch_isidst -#define lo _sch_islower -#define nv _sch_isnvsp -#define pn _sch_ispunct -#define pr _sch_isprint -#define sp _sch_isspace -#define up _sch_isupper -#define vs _sch_isvsp -#define xd _sch_isxdigit - -/* Masks. */ -#define L lo|is |pr /* lower case letter */ -#define XL lo|is|xd|pr /* lowercase hex digit */ -#define U up|is |pr /* upper case letter */ -#define XU up|is|xd|pr /* uppercase hex digit */ -#define D di |xd|pr /* decimal digit */ -#define P pn |pr /* punctuation */ -#define _ pn|is |pr /* underscore */ - -#define C cn /* control character */ -#define Z nv |cn /* NUL */ -#define M nv|sp |cn /* cursor movement: \f \v */ -#define V vs|sp |cn /* vertical space: \r \n */ -#define T nv|sp|bl|cn /* tab */ -#define S nv|sp|bl|pr /* space */ - -/* Are we ASCII? */ -#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \ - && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \ - && EOF == -1 - -const unsigned short _sch_istable[256] = -{ - Z, C, C, C, C, C, C, C, /* NUL SOH STX ETX EOT ENQ ACK BEL */ - C, T, V, M, M, V, C, C, /* BS HT LF VT FF CR SO SI */ - C, C, C, C, C, C, C, C, /* DLE DC1 DC2 DC3 DC4 NAK SYN ETB */ - C, C, C, C, C, C, C, C, /* CAN EM SUB ESC FS GS RS US */ - S, P, P, P, P, P, P, P, /* SP ! " # $ % & ' */ - P, P, P, P, P, P, P, P, /* ( ) * + , - . / */ - D, D, D, D, D, D, D, D, /* 0 1 2 3 4 5 6 7 */ - D, D, P, P, P, P, P, P, /* 8 9 : ; < = > ? */ - P, XU, XU, XU, XU, XU, XU, U, /* @ A B C D E F G */ - U, U, U, U, U, U, U, U, /* H I J K L M N O */ - U, U, U, U, U, U, U, U, /* P Q R S T U V W */ - U, U, U, P, P, P, P, _, /* X Y Z [ \ ] ^ _ */ - P, XL, XL, XL, XL, XL, XL, L, /* ` a b c d e f g */ - L, L, L, L, L, L, L, L, /* h i j k l m n o */ - L, L, L, L, L, L, L, L, /* p q r s t u v w */ - L, L, L, P, P, P, P, C, /* x y z { | } ~ DEL */ - - /* high half of unsigned char is locale-specific, so all tests are - false in "C" locale */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -const unsigned char _sch_tolower[256] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, - - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', - 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - - 91, 92, 93, 94, 95, 96, - - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', - 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - - 123,124,125,126,127, - - 128,129,130,131, 132,133,134,135, 136,137,138,139, 140,141,142,143, - 144,145,146,147, 148,149,150,151, 152,153,154,155, 156,157,158,159, - 160,161,162,163, 164,165,166,167, 168,169,170,171, 172,173,174,175, - 176,177,178,179, 180,181,182,183, 184,185,186,187, 188,189,190,191, - - 192,193,194,195, 196,197,198,199, 200,201,202,203, 204,205,206,207, - 208,209,210,211, 212,213,214,215, 216,217,218,219, 220,221,222,223, - 224,225,226,227, 228,229,230,231, 232,233,234,235, 236,237,238,239, - 240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255, -}; - -const unsigned char _sch_toupper[256] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, - - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - - 91, 92, 93, 94, 95, 96, - - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - - 123,124,125,126,127, - - 128,129,130,131, 132,133,134,135, 136,137,138,139, 140,141,142,143, - 144,145,146,147, 148,149,150,151, 152,153,154,155, 156,157,158,159, - 160,161,162,163, 164,165,166,167, 168,169,170,171, 172,173,174,175, - 176,177,178,179, 180,181,182,183, 184,185,186,187, 188,189,190,191, - - 192,193,194,195, 196,197,198,199, 200,201,202,203, 204,205,206,207, - 208,209,210,211, 212,213,214,215, 216,217,218,219, 220,221,222,223, - 224,225,226,227, 228,229,230,231, 232,233,234,235, 236,237,238,239, - 240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255, -}; - -#else - #error "Unsupported host character set" -#endif /* not ASCII */ diff --git a/gnu/egcs/libiberty/setenv.c b/gnu/egcs/libiberty/setenv.c deleted file mode 100644 index eec13006c22..00000000000 --- a/gnu/egcs/libiberty/setenv.c +++ /dev/null @@ -1,163 +0,0 @@ -/* Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. - This file based on setenv.c in the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "ansidecl.h" -#include <sys/types.h> /* For `size_t' */ -#include <stdio.h> /* For `NULL' */ - -#include <errno.h> -#if !defined(errno) && !defined(HAVE_ERRNO_DECL) -extern int errno; -#endif -#define __set_errno(ev) ((errno) = (ev)) - -#if HAVE_STDLIB_H -# include <stdlib.h> -#endif -#if HAVE_STRING_H -# include <string.h> -#endif -#if HAVE_UNISTD_H -# include <unistd.h> -#endif - -#define __environ environ -#ifndef HAVE_ENVIRON_DECL -extern char **environ; -#endif - -/* LOCK and UNLOCK are defined as no-ops. This makes the libiberty - * implementation MT-Unsafe. */ -#define LOCK -#define UNLOCK - -/* Below this point, it's verbatim code from the glibc-2.0 implementation */ - -/* If this variable is not a null pointer we allocated the current - environment. */ -static char **last_environ; - - -int -setenv (name, value, replace) - const char *name; - const char *value; - int replace; -{ - register char **ep; - register size_t size; - const size_t namelen = strlen (name); - const size_t vallen = strlen (value) + 1; - - LOCK; - - size = 0; - if (__environ != NULL) - for (ep = __environ; *ep != NULL; ++ep) - if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=') - break; - else - ++size; - - if (__environ == NULL || *ep == NULL) - { - char **new_environ; - if (__environ == last_environ && __environ != NULL) - /* We allocated this space; we can extend it. */ - new_environ = (char **) realloc (last_environ, - (size + 2) * sizeof (char *)); - else - new_environ = (char **) malloc ((size + 2) * sizeof (char *)); - - if (new_environ == NULL) - { - UNLOCK; - return -1; - } - - new_environ[size] = malloc (namelen + 1 + vallen); - if (new_environ[size] == NULL) - { - free ((char *) new_environ); - __set_errno (ENOMEM); - UNLOCK; - return -1; - } - - if (__environ != last_environ) - memcpy ((char *) new_environ, (char *) __environ, - size * sizeof (char *)); - - memcpy (new_environ[size], name, namelen); - new_environ[size][namelen] = '='; - memcpy (&new_environ[size][namelen + 1], value, vallen); - - new_environ[size + 1] = NULL; - - last_environ = __environ = new_environ; - } - else if (replace) - { - size_t len = strlen (*ep); - if (len + 1 < namelen + 1 + vallen) - { - /* The existing string is too short; malloc a new one. */ - char *new = malloc (namelen + 1 + vallen); - if (new == NULL) - { - UNLOCK; - return -1; - } - *ep = new; - } - memcpy (*ep, name, namelen); - (*ep)[namelen] = '='; - memcpy (&(*ep)[namelen + 1], value, vallen); - } - - UNLOCK; - - return 0; -} - -void -unsetenv (name) - const char *name; -{ - const size_t len = strlen (name); - char **ep; - - LOCK; - - for (ep = __environ; *ep; ++ep) - if (!strncmp (*ep, name, len) && (*ep)[len] == '=') - { - /* Found it. Remove this pointer by moving later ones back. */ - char **dp = ep; - do - dp[0] = dp[1]; - while (*dp++); - /* Continue the loop in case NAME appears again. */ - } - - UNLOCK; -} diff --git a/gnu/egcs/libiberty/shlib_version b/gnu/egcs/libiberty/shlib_version deleted file mode 100644 index 3066b9771e7..00000000000 --- a/gnu/egcs/libiberty/shlib_version +++ /dev/null @@ -1,2 +0,0 @@ -major=5 -minor=0 diff --git a/gnu/egcs/libiberty/sigsetmask.c b/gnu/egcs/libiberty/sigsetmask.c deleted file mode 100644 index 2a09e6a6c5a..00000000000 --- a/gnu/egcs/libiberty/sigsetmask.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Version of sigsetmask.c - Written by Steve Chamberlain (sac@cygnus.com). - Contributed by Cygnus Support. - This file is in the public doamin. */ - -/* Set the current signal mask to the set provided, and return the - previous value */ - -#define _POSIX_SOURCE -#include <ansidecl.h> -/* Including <sys/types.h> seems to be needed by ISC. */ -#include <sys/types.h> -#include <signal.h> - -#ifdef SIG_SETMASK -int -DEFUN(sigsetmask,(set), - int set) -{ - sigset_t new; - sigset_t old; - - sigemptyset (&new); - if (set != 0) { - abort(); /* FIXME, we don't know how to translate old mask to new */ - } - sigprocmask(SIG_SETMASK, &new, &old); - return 1; /* FIXME, we always return 1 as old value. */ -} -#endif diff --git a/gnu/egcs/libiberty/sort.c b/gnu/egcs/libiberty/sort.c deleted file mode 100644 index 90c97e04e07..00000000000 --- a/gnu/egcs/libiberty/sort.c +++ /dev/null @@ -1,190 +0,0 @@ -/* Sorting algorithms. - Copyright (C) 2000 Free Software Foundation, Inc. - Contributed by Mark Mitchell <mark@codesourcery.com>. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "libiberty.h" -#include "sort.h" -#ifdef HAVE_LIMITS_H -#include <limits.h> -#endif -#ifdef HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif - -#ifndef UCHAR_MAX -#define UCHAR_MAX ((unsigned char)(-1)) -#endif - -/* POINTERS and WORK are both arrays of N pointers. When this - function returns POINTERS will be sorted in ascending order. */ - -void sort_pointers (n, pointers, work) - size_t n; - void **pointers; - void **work; -{ - /* The type of a single digit. This can be any unsigned integral - type. When changing this, DIGIT_MAX should be changed as - well. */ - typedef unsigned char digit_t; - - /* The maximum value a single digit can have. */ -#define DIGIT_MAX (UCHAR_MAX + 1) - - /* The Ith entry is the number of elements in *POINTERSP that have I - in the digit on which we are currently sorting. */ - unsigned int count[DIGIT_MAX]; - /* Nonzero if we are running on a big-endian machine. */ - int big_endian_p; - size_t i; - size_t j; - - /* The algorithm used here is radix sort which takes time linear in - the number of elements in the array. */ - - /* The algorithm here depends on being able to swap the two arrays - an even number of times. */ - if ((sizeof (void *) / sizeof (digit_t)) % 2 != 0) - abort (); - - /* Figure out the endianness of the machine. */ - for (i = 0, j = 0; i < sizeof (size_t); ++i) - { - j *= (UCHAR_MAX + 1); - j += i; - } - big_endian_p = (((char *)&j)[0] == 0); - - /* Move through the pointer values from least significant to most - significant digits. */ - for (i = 0; i < sizeof (void *) / sizeof (digit_t); ++i) - { - digit_t *digit; - digit_t *bias; - digit_t *top; - unsigned int *countp; - void **pointerp; - - /* The offset from the start of the pointer will depend on the - endianness of the machine. */ - if (big_endian_p) - j = sizeof (void *) / sizeof (digit_t) - i; - else - j = i; - - /* Now, perform a stable sort on this digit. We use counting - sort. */ - memset (count, 0, DIGIT_MAX * sizeof (unsigned int)); - - /* Compute the address of the appropriate digit in the first and - one-past-the-end elements of the array. On a little-endian - machine, the least-significant digit is closest to the front. */ - bias = ((digit_t *) pointers) + j; - top = ((digit_t *) (pointers + n)) + j; - - /* Count how many there are of each value. At the end of this - loop, COUNT[K] will contain the number of pointers whose Ith - digit is K. */ - for (digit = bias; - digit < top; - digit += sizeof (void *) / sizeof (digit_t)) - ++count[*digit]; - - /* Now, make COUNT[K] contain the number of pointers whose Ith - digit is less than or equal to K. */ - for (countp = count + 1; countp < count + DIGIT_MAX; ++countp) - *countp += countp[-1]; - - /* Now, drop the pointers into their correct locations. */ - for (pointerp = pointers + n - 1; pointerp >= pointers; --pointerp) - work[--count[((digit_t *) pointerp)[j]]] = *pointerp; - - /* Swap WORK and POINTERS so that POINTERS contains the sorted - array. */ - pointerp = pointers; - pointers = work; - work = pointerp; - } -} - -/* Everything below here is a unit test for the routines in this - file. */ - -#ifdef UNIT_TEST - -#include <stdio.h> - -void *xmalloc (n) - size_t n; -{ - return malloc (n); -} - -int main (int argc, char **argv) -{ - int k; - int result; - size_t i; - void **pointers; - void **work; - - if (argc > 1) - k = atoi (argv[1]); - else - k = 10; - - pointers = xmalloc (k * sizeof (void *)); - work = xmalloc (k * sizeof (void *)); - - for (i = 0; i < k; ++i) - { - pointers[i] = (void *) random (); - printf ("%x\n", pointers[i]); - } - - sort_pointers (k, pointers, work); - - printf ("\nSorted\n\n"); - - result = 0; - - for (i = 0; i < k; ++i) - { - printf ("%x\n", pointers[i]); - if (i > 0 && (char*) pointers[i] < (char*) pointers[i - 1]) - result = 1; - } - - free (pointers); - free (work); - - return result; -} - -#endif diff --git a/gnu/egcs/libiberty/spaces.c b/gnu/egcs/libiberty/spaces.c deleted file mode 100644 index ea925712e3f..00000000000 --- a/gnu/egcs/libiberty/spaces.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Allocate memory region filled with spaces. - Copyright (C) 1991 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* - -NAME - - spaces -- return a pointer to a buffer full of spaces - -SYNOPSIS - - char *spaces (int count) - -DESCRIPTION - - Returns a pointer to a memory region filled with the specified - number of spaces and null terminated. The returned pointer is - valid until at least the next call. - -BUGS - -*/ - -#include "ansidecl.h" -#include "libiberty.h" - -#if VMS -#include <stdlib.h> -#include <unixlib.h> -#else -/* For systems with larger pointers than ints, these must be declared. */ -extern PTR malloc PARAMS ((size_t)); -extern void free PARAMS ((PTR)); -#endif - -const char * -spaces (count) - int count; -{ - register char *t; - static char *buf; - static int maxsize; - - if (count > maxsize) - { - if (buf) - { - free (buf); - } - buf = malloc (count + 1); - if (buf == (char *) 0) - return 0; - for (t = buf + count ; t != buf ; ) - { - *--t = ' '; - } - maxsize = count; - buf[count] = '\0'; - } - return (const char *) (buf + maxsize - count); -} - diff --git a/gnu/egcs/libiberty/splay-tree.c b/gnu/egcs/libiberty/splay-tree.c deleted file mode 100644 index 22ea07d84ad..00000000000 --- a/gnu/egcs/libiberty/splay-tree.c +++ /dev/null @@ -1,370 +0,0 @@ -/* A splay-tree datatype. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - Contributed by Mark Mitchell (mark@markmitchell.com). - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* For an easily readable description of splay-trees, see: - - Lewis, Harry R. and Denenberg, Larry. Data Structures and Their - Algorithms. Harper-Collins, Inc. 1991. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#include "libiberty.h" -#include "splay-tree.h" - -static void splay_tree_delete_helper PARAMS((splay_tree, - splay_tree_node)); -static void splay_tree_splay PARAMS((splay_tree, - splay_tree_key)); -static splay_tree_node splay_tree_splay_helper - PARAMS((splay_tree, - splay_tree_key, - splay_tree_node*, - splay_tree_node*, - splay_tree_node*)); -static int splay_tree_foreach_helper PARAMS((splay_tree, - splay_tree_node, - splay_tree_foreach_fn, - void*)); - -/* Deallocate NODE (a member of SP), and all its sub-trees. */ - -static void -splay_tree_delete_helper (sp, node) - splay_tree sp; - splay_tree_node node; -{ - if (!node) - return; - - splay_tree_delete_helper (sp, node->left); - splay_tree_delete_helper (sp, node->right); - - if (sp->delete_key) - (*sp->delete_key)(node->key); - if (sp->delete_value) - (*sp->delete_value)(node->value); - - free ((char*) node); -} - -/* Help splay SP around KEY. PARENT and GRANDPARENT are the parent - and grandparent, respectively, of NODE. */ - -static splay_tree_node -splay_tree_splay_helper (sp, key, node, parent, grandparent) - splay_tree sp; - splay_tree_key key; - splay_tree_node *node; - splay_tree_node *parent; - splay_tree_node *grandparent; -{ - splay_tree_node *next; - splay_tree_node n; - int comparison; - - n = *node; - - if (!n) - return *parent; - - comparison = (*sp->comp) (key, n->key); - - if (comparison == 0) - /* We've found the target. */ - next = 0; - else if (comparison < 0) - /* The target is to the left. */ - next = &n->left; - else - /* The target is to the right. */ - next = &n->right; - - if (next) - { - /* Continue down the tree. */ - n = splay_tree_splay_helper (sp, key, next, node, parent); - - /* The recursive call will change the place to which NODE - points. */ - if (*node != n) - return n; - } - - if (!parent) - /* NODE is the root. We are done. */ - return n; - - /* First, handle the case where there is no grandparent (i.e., - *PARENT is the root of the tree.) */ - if (!grandparent) - { - if (n == (*parent)->left) - { - *node = n->right; - n->right = *parent; - } - else - { - *node = n->left; - n->left = *parent; - } - *parent = n; - return n; - } - - /* Next handle the cases where both N and *PARENT are left children, - or where both are right children. */ - if (n == (*parent)->left && *parent == (*grandparent)->left) - { - splay_tree_node p = *parent; - - (*grandparent)->left = p->right; - p->right = *grandparent; - p->left = n->right; - n->right = p; - *grandparent = n; - return n; - } - else if (n == (*parent)->right && *parent == (*grandparent)->right) - { - splay_tree_node p = *parent; - - (*grandparent)->right = p->left; - p->left = *grandparent; - p->right = n->left; - n->left = p; - *grandparent = n; - return n; - } - - /* Finally, deal with the case where N is a left child, but *PARENT - is a right child, or vice versa. */ - if (n == (*parent)->left) - { - (*parent)->left = n->right; - n->right = *parent; - (*grandparent)->right = n->left; - n->left = *grandparent; - *grandparent = n; - return n; - } - else - { - (*parent)->right = n->left; - n->left = *parent; - (*grandparent)->left = n->right; - n->right = *grandparent; - *grandparent = n; - return n; - } -} - -/* Splay SP around KEY. */ - -static void -splay_tree_splay (sp, key) - splay_tree sp; - splay_tree_key key; -{ - if (sp->root == 0) - return; - - splay_tree_splay_helper (sp, key, &sp->root, - /*grandparent=*/0, /*parent=*/0); -} - -/* Call FN, passing it the DATA, for every node below NODE, all of - which are from SP, following an in-order traversal. If FN every - returns a non-zero value, the iteration ceases immediately, and the - value is returned. Otherwise, this function returns 0. */ - -static int -splay_tree_foreach_helper (sp, node, fn, data) - splay_tree sp; - splay_tree_node node; - splay_tree_foreach_fn fn; - void* data; -{ - int val; - - if (!node) - return 0; - - val = splay_tree_foreach_helper (sp, node->left, fn, data); - if (val) - return val; - - val = (*fn)(node, data); - if (val) - return val; - - return splay_tree_foreach_helper (sp, node->right, fn, data); -} - -/* Allocate a new splay tree, using COMPARE_FN to compare nodes, - DELETE_KEY_FN to deallocate keys, and DELETE_VALUE_FN to deallocate - values. */ - -splay_tree -splay_tree_new (compare_fn, delete_key_fn, delete_value_fn) - splay_tree_compare_fn compare_fn; - splay_tree_delete_key_fn delete_key_fn; - splay_tree_delete_value_fn delete_value_fn; -{ - splay_tree sp = (splay_tree) xmalloc (sizeof (struct splay_tree_s)); - sp->root = 0; - sp->comp = compare_fn; - sp->delete_key = delete_key_fn; - sp->delete_value = delete_value_fn; - - return sp; -} - -/* Deallocate SP. */ - -void -splay_tree_delete (sp) - splay_tree sp; -{ - splay_tree_delete_helper (sp, sp->root); - free ((char*) sp); -} - -/* Insert a new node (associating KEY with DATA) into SP. If a - previous node with the indicated KEY exists, its data is replaced - with the new value. Returns the new node. */ - -splay_tree_node -splay_tree_insert (sp, key, value) - splay_tree sp; - splay_tree_key key; - splay_tree_value value; -{ - int comparison = 0; - - splay_tree_splay (sp, key); - - if (sp->root) - comparison = (*sp->comp)(sp->root->key, key); - - if (sp->root && comparison == 0) - { - /* If the root of the tree already has the indicated KEY, just - replace the value with VALUE. */ - if (sp->delete_value) - (*sp->delete_value)(sp->root->value); - sp->root->value = value; - } - else - { - /* Create a new node, and insert it at the root. */ - splay_tree_node node; - - node = (splay_tree_node) xmalloc (sizeof (struct splay_tree_node_s)); - node->key = key; - node->value = value; - - if (!sp->root) - node->left = node->right = 0; - else if (comparison < 0) - { - node->left = sp->root; - node->right = node->left->right; - node->left->right = 0; - } - else - { - node->right = sp->root; - node->left = node->right->left; - node->right->left = 0; - } - - sp->root = node; - } - - return sp->root; -} - -/* Lookup KEY in SP, returning VALUE if present, and NULL - otherwise. */ - -splay_tree_node -splay_tree_lookup (sp, key) - splay_tree sp; - splay_tree_key key; -{ - splay_tree_splay (sp, key); - - if (sp->root && (*sp->comp)(sp->root->key, key) == 0) - return sp->root; - else - return 0; -} - -/* Call FN, passing it the DATA, for every node in SP, following an - in-order traversal. If FN every returns a non-zero value, the - iteration ceases immediately, and the value is returned. - Otherwise, this function returns 0. */ - -int -splay_tree_foreach (sp, fn, data) - splay_tree sp; - splay_tree_foreach_fn fn; - void *data; -{ - return splay_tree_foreach_helper (sp, sp->root, fn, data); -} - -/* Splay-tree comparison function, treating the keys as ints. */ - -int -splay_tree_compare_ints (k1, k2) - splay_tree_key k1; - splay_tree_key k2; -{ - if ((int) k1 < (int) k2) - return -1; - else if ((int) k1 > (int) k2) - return 1; - else - return 0; -} - -/* Splay-tree comparison function, treating the keys as pointers. */ - -int -splay_tree_compare_pointers (k1, k2) - splay_tree_key k1; - splay_tree_key k2; -{ - if ((char*) k1 < (char*) k2) - return -1; - else if ((char*) k1 > (char*) k2) - return 1; - else - return 0; -} diff --git a/gnu/egcs/libiberty/strcasecmp.c b/gnu/egcs/libiberty/strcasecmp.c deleted file mode 100644 index 3aa930b696f..00000000000 --- a/gnu/egcs/libiberty/strcasecmp.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1987 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of California at Berkeley. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific written prior permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; -#endif /* LIBC_SCCS and not lint */ - -#include <ansidecl.h> -#ifdef __STDC__ -#include <stddef.h> -#else -#define size_t unsigned long -#endif - -/* - * This array is designed for mapping upper and lower case letter - * together for a case independent comparison. The mappings are - * based upon ascii character sequences. - */ -typedef unsigned char uc; -static unsigned char charmap[] = { - (uc)'\000',(uc)'\001',(uc)'\002',(uc)'\003',(uc)'\004',(uc)'\005',(uc)'\006',(uc)'\007', - (uc)'\010',(uc)'\011',(uc)'\012',(uc)'\013',(uc)'\014',(uc)'\015',(uc)'\016',(uc)'\017', - (uc)'\020',(uc)'\021',(uc)'\022',(uc)'\023',(uc)'\024',(uc)'\025',(uc)'\026',(uc)'\027', - (uc)'\030',(uc)'\031',(uc)'\032',(uc)'\033',(uc)'\034',(uc)'\035',(uc)'\036',(uc)'\037', - (uc)'\040',(uc)'\041',(uc)'\042',(uc)'\043',(uc)'\044',(uc)'\045',(uc)'\046',(uc)'\047', - (uc)'\050',(uc)'\051',(uc)'\052',(uc)'\053',(uc)'\054',(uc)'\055',(uc)'\056',(uc)'\057', - (uc)'\060',(uc)'\061',(uc)'\062',(uc)'\063',(uc)'\064',(uc)'\065',(uc)'\066',(uc)'\067', - (uc)'\070',(uc)'\071',(uc)'\072',(uc)'\073',(uc)'\074',(uc)'\075',(uc)'\076',(uc)'\077', - (uc)'\100',(uc)'\141',(uc)'\142',(uc)'\143',(uc)'\144',(uc)'\145',(uc)'\146',(uc)'\147', - (uc)'\150',(uc)'\151',(uc)'\152',(uc)'\153',(uc)'\154',(uc)'\155',(uc)'\156',(uc)'\157', - (uc)'\160',(uc)'\161',(uc)'\162',(uc)'\163',(uc)'\164',(uc)'\165',(uc)'\166',(uc)'\167', - (uc)'\170',(uc)'\171',(uc)'\172',(uc)'\133',(uc)'\134',(uc)'\135',(uc)'\136',(uc)'\137', - (uc)'\140',(uc)'\141',(uc)'\142',(uc)'\143',(uc)'\144',(uc)'\145',(uc)'\146',(uc)'\147', - (uc)'\150',(uc)'\151',(uc)'\152',(uc)'\153',(uc)'\154',(uc)'\155',(uc)'\156',(uc)'\157', - (uc)'\160',(uc)'\161',(uc)'\162',(uc)'\163',(uc)'\164',(uc)'\165',(uc)'\166',(uc)'\167', - (uc)'\170',(uc)'\171',(uc)'\172',(uc)'\173',(uc)'\174',(uc)'\175',(uc)'\176',(uc)'\177', - (uc)'\200',(uc)'\201',(uc)'\202',(uc)'\203',(uc)'\204',(uc)'\205',(uc)'\206',(uc)'\207', - (uc)'\210',(uc)'\211',(uc)'\212',(uc)'\213',(uc)'\214',(uc)'\215',(uc)'\216',(uc)'\217', - (uc)'\220',(uc)'\221',(uc)'\222',(uc)'\223',(uc)'\224',(uc)'\225',(uc)'\226',(uc)'\227', - (uc)'\230',(uc)'\231',(uc)'\232',(uc)'\233',(uc)'\234',(uc)'\235',(uc)'\236',(uc)'\237', - (uc)'\240',(uc)'\241',(uc)'\242',(uc)'\243',(uc)'\244',(uc)'\245',(uc)'\246',(uc)'\247', - (uc)'\250',(uc)'\251',(uc)'\252',(uc)'\253',(uc)'\254',(uc)'\255',(uc)'\256',(uc)'\257', - (uc)'\260',(uc)'\261',(uc)'\262',(uc)'\263',(uc)'\264',(uc)'\265',(uc)'\266',(uc)'\267', - (uc)'\270',(uc)'\271',(uc)'\272',(uc)'\273',(uc)'\274',(uc)'\275',(uc)'\276',(uc)'\277', - (uc)'\300',(uc)'\341',(uc)'\342',(uc)'\343',(uc)'\344',(uc)'\345',(uc)'\346',(uc)'\347', - (uc)'\350',(uc)'\351',(uc)'\352',(uc)'\353',(uc)'\354',(uc)'\355',(uc)'\356',(uc)'\357', - (uc)'\360',(uc)'\361',(uc)'\362',(uc)'\363',(uc)'\364',(uc)'\365',(uc)'\366',(uc)'\367', - (uc)'\370',(uc)'\371',(uc)'\372',(uc)'\333',(uc)'\334',(uc)'\335',(uc)'\336',(uc)'\337', - (uc)'\340',(uc)'\341',(uc)'\342',(uc)'\343',(uc)'\344',(uc)'\345',(uc)'\346',(uc)'\347', - (uc)'\350',(uc)'\351',(uc)'\352',(uc)'\353',(uc)'\354',(uc)'\355',(uc)'\356',(uc)'\357', - (uc)'\360',(uc)'\361',(uc)'\362',(uc)'\363',(uc)'\364',(uc)'\365',(uc)'\366',(uc)'\367', - (uc)'\370',(uc)'\371',(uc)'\372',(uc)'\373',(uc)'\374',(uc)'\375',(uc)'\376',(uc)'\377', -}; - -int -strcasecmp(s1, s2) - const char *s1, *s2; -{ - register unsigned char u1, u2; - - for (;;) { - u1 = (unsigned char) *s1++; - u2 = (unsigned char) *s2++; - if (charmap[u1] != charmap[u2]) { - return charmap[u1] - charmap[u2]; - } - if (u1 == '\0') { - return 0; - } - } -} - diff --git a/gnu/egcs/libiberty/strchr.c b/gnu/egcs/libiberty/strchr.c deleted file mode 100644 index 550480f56de..00000000000 --- a/gnu/egcs/libiberty/strchr.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Portable version of strchr() - This function is in the public domain. */ - -/* -NAME - strchr -- return pointer to first occurance of a character - -SYNOPSIS - char *strchr (const char *s, int c) - -DESCRIPTION - Returns a pointer to the first occurance of character C in - string S, or a NULL pointer if no occurance is found. - -BUGS - Behavior when character is the null character is implementation - dependent. -*/ - -#include <ansidecl.h> - -char * -strchr (s, c) - register const char *s; - int c; -{ - do { - if (*s == c) - { - return (char*)s; - } - } while (*s++); - return (0); -} diff --git a/gnu/egcs/libiberty/strdup.c b/gnu/egcs/libiberty/strdup.c deleted file mode 100644 index 1785b34f274..00000000000 --- a/gnu/egcs/libiberty/strdup.c +++ /dev/null @@ -1,10 +0,0 @@ -char * -strdup(s) - char *s; -{ - char *result = (char*)malloc(strlen(s) + 1); - if (result == (char*)0) - return (char*)0; - strcpy(result, s); - return result; -} diff --git a/gnu/egcs/libiberty/strerror.c b/gnu/egcs/libiberty/strerror.c deleted file mode 100644 index ae7e29bfa89..00000000000 --- a/gnu/egcs/libiberty/strerror.c +++ /dev/null @@ -1,831 +0,0 @@ -/* Extended support for using errno values. - Written by Fred Fish. fnf@cygnus.com - This file is in the public domain. --Per Bothner. */ - -#include "ansidecl.h" -#include "libiberty.h" - -#include "config.h" - -#ifdef HAVE_SYS_ERRLIST -/* Note that errno.h (not sure what OS) or stdio.h (BSD 4.4, at least) - might declare sys_errlist in a way that the compiler might consider - incompatible with our later declaration, perhaps by using const - attributes. So we hide the declaration in errno.h (if any) using a - macro. */ -#define sys_errlist sys_errlist__ -#endif - -#include <stdio.h> -#include <errno.h> - -#ifdef HAVE_SYS_ERRLIST -#undef sys_errlist -#endif - -/* Routines imported from standard C runtime libraries. */ - -#ifdef __STDC__ -#include <stddef.h> -extern void *malloc (size_t size); /* 4.10.3.3 */ -extern void *memset (void *s, int c, size_t n); /* 4.11.6.1 */ -#else /* !__STDC__ */ -extern char *malloc (); /* Standard memory allocater */ -extern char *memset (); -#endif /* __STDC__ */ - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - -static void init_error_tables PARAMS ((void)); - -/* Translation table for errno values. See intro(2) in most UNIX systems - Programmers Reference Manuals. - - Note that this table is generally only accessed when it is used at runtime - to initialize errno name and message tables that are indexed by errno - value. - - Not all of these errnos will exist on all systems. This table is the only - thing that should have to be updated as new error numbers are introduced. - It's sort of ugly, but at least its portable. */ - -struct error_info -{ - int value; /* The numeric value from <errno.h> */ - const char *name; /* The equivalent symbolic value */ -#ifndef HAVE_SYS_ERRLIST - const char *msg; /* Short message about this value */ -#endif -}; - -#ifndef HAVE_SYS_ERRLIST -# define ENTRY(value, name, msg) {value, name, msg} -#else -# define ENTRY(value, name, msg) {value, name} -#endif - -static const struct error_info error_table[] = -{ -#if defined (EPERM) - ENTRY(EPERM, "EPERM", "Not owner"), -#endif -#if defined (ENOENT) - ENTRY(ENOENT, "ENOENT", "No such file or directory"), -#endif -#if defined (ESRCH) - ENTRY(ESRCH, "ESRCH", "No such process"), -#endif -#if defined (EINTR) - ENTRY(EINTR, "EINTR", "Interrupted system call"), -#endif -#if defined (EIO) - ENTRY(EIO, "EIO", "I/O error"), -#endif -#if defined (ENXIO) - ENTRY(ENXIO, "ENXIO", "No such device or address"), -#endif -#if defined (E2BIG) - ENTRY(E2BIG, "E2BIG", "Arg list too long"), -#endif -#if defined (ENOEXEC) - ENTRY(ENOEXEC, "ENOEXEC", "Exec format error"), -#endif -#if defined (EBADF) - ENTRY(EBADF, "EBADF", "Bad file number"), -#endif -#if defined (ECHILD) - ENTRY(ECHILD, "ECHILD", "No child processes"), -#endif -#if defined (EWOULDBLOCK) /* Put before EAGAIN, sometimes aliased */ - ENTRY(EWOULDBLOCK, "EWOULDBLOCK", "Operation would block"), -#endif -#if defined (EAGAIN) - ENTRY(EAGAIN, "EAGAIN", "No more processes"), -#endif -#if defined (ENOMEM) - ENTRY(ENOMEM, "ENOMEM", "Not enough space"), -#endif -#if defined (EACCES) - ENTRY(EACCES, "EACCES", "Permission denied"), -#endif -#if defined (EFAULT) - ENTRY(EFAULT, "EFAULT", "Bad address"), -#endif -#if defined (ENOTBLK) - ENTRY(ENOTBLK, "ENOTBLK", "Block device required"), -#endif -#if defined (EBUSY) - ENTRY(EBUSY, "EBUSY", "Device busy"), -#endif -#if defined (EEXIST) - ENTRY(EEXIST, "EEXIST", "File exists"), -#endif -#if defined (EXDEV) - ENTRY(EXDEV, "EXDEV", "Cross-device link"), -#endif -#if defined (ENODEV) - ENTRY(ENODEV, "ENODEV", "No such device"), -#endif -#if defined (ENOTDIR) - ENTRY(ENOTDIR, "ENOTDIR", "Not a directory"), -#endif -#if defined (EISDIR) - ENTRY(EISDIR, "EISDIR", "Is a directory"), -#endif -#if defined (EINVAL) - ENTRY(EINVAL, "EINVAL", "Invalid argument"), -#endif -#if defined (ENFILE) - ENTRY(ENFILE, "ENFILE", "File table overflow"), -#endif -#if defined (EMFILE) - ENTRY(EMFILE, "EMFILE", "Too many open files"), -#endif -#if defined (ENOTTY) - ENTRY(ENOTTY, "ENOTTY", "Not a typewriter"), -#endif -#if defined (ETXTBSY) - ENTRY(ETXTBSY, "ETXTBSY", "Text file busy"), -#endif -#if defined (EFBIG) - ENTRY(EFBIG, "EFBIG", "File too large"), -#endif -#if defined (ENOSPC) - ENTRY(ENOSPC, "ENOSPC", "No space left on device"), -#endif -#if defined (ESPIPE) - ENTRY(ESPIPE, "ESPIPE", "Illegal seek"), -#endif -#if defined (EROFS) - ENTRY(EROFS, "EROFS", "Read-only file system"), -#endif -#if defined (EMLINK) - ENTRY(EMLINK, "EMLINK", "Too many links"), -#endif -#if defined (EPIPE) - ENTRY(EPIPE, "EPIPE", "Broken pipe"), -#endif -#if defined (EDOM) - ENTRY(EDOM, "EDOM", "Math argument out of domain of func"), -#endif -#if defined (ERANGE) - ENTRY(ERANGE, "ERANGE", "Math result not representable"), -#endif -#if defined (ENOMSG) - ENTRY(ENOMSG, "ENOMSG", "No message of desired type"), -#endif -#if defined (EIDRM) - ENTRY(EIDRM, "EIDRM", "Identifier removed"), -#endif -#if defined (ECHRNG) - ENTRY(ECHRNG, "ECHRNG", "Channel number out of range"), -#endif -#if defined (EL2NSYNC) - ENTRY(EL2NSYNC, "EL2NSYNC", "Level 2 not synchronized"), -#endif -#if defined (EL3HLT) - ENTRY(EL3HLT, "EL3HLT", "Level 3 halted"), -#endif -#if defined (EL3RST) - ENTRY(EL3RST, "EL3RST", "Level 3 reset"), -#endif -#if defined (ELNRNG) - ENTRY(ELNRNG, "ELNRNG", "Link number out of range"), -#endif -#if defined (EUNATCH) - ENTRY(EUNATCH, "EUNATCH", "Protocol driver not attached"), -#endif -#if defined (ENOCSI) - ENTRY(ENOCSI, "ENOCSI", "No CSI structure available"), -#endif -#if defined (EL2HLT) - ENTRY(EL2HLT, "EL2HLT", "Level 2 halted"), -#endif -#if defined (EDEADLK) - ENTRY(EDEADLK, "EDEADLK", "Deadlock condition"), -#endif -#if defined (ENOLCK) - ENTRY(ENOLCK, "ENOLCK", "No record locks available"), -#endif -#if defined (EBADE) - ENTRY(EBADE, "EBADE", "Invalid exchange"), -#endif -#if defined (EBADR) - ENTRY(EBADR, "EBADR", "Invalid request descriptor"), -#endif -#if defined (EXFULL) - ENTRY(EXFULL, "EXFULL", "Exchange full"), -#endif -#if defined (ENOANO) - ENTRY(ENOANO, "ENOANO", "No anode"), -#endif -#if defined (EBADRQC) - ENTRY(EBADRQC, "EBADRQC", "Invalid request code"), -#endif -#if defined (EBADSLT) - ENTRY(EBADSLT, "EBADSLT", "Invalid slot"), -#endif -#if defined (EDEADLOCK) - ENTRY(EDEADLOCK, "EDEADLOCK", "File locking deadlock error"), -#endif -#if defined (EBFONT) - ENTRY(EBFONT, "EBFONT", "Bad font file format"), -#endif -#if defined (ENOSTR) - ENTRY(ENOSTR, "ENOSTR", "Device not a stream"), -#endif -#if defined (ENODATA) - ENTRY(ENODATA, "ENODATA", "No data available"), -#endif -#if defined (ETIME) - ENTRY(ETIME, "ETIME", "Timer expired"), -#endif -#if defined (ENOSR) - ENTRY(ENOSR, "ENOSR", "Out of streams resources"), -#endif -#if defined (ENONET) - ENTRY(ENONET, "ENONET", "Machine is not on the network"), -#endif -#if defined (ENOPKG) - ENTRY(ENOPKG, "ENOPKG", "Package not installed"), -#endif -#if defined (EREMOTE) - ENTRY(EREMOTE, "EREMOTE", "Object is remote"), -#endif -#if defined (ENOLINK) - ENTRY(ENOLINK, "ENOLINK", "Link has been severed"), -#endif -#if defined (EADV) - ENTRY(EADV, "EADV", "Advertise error"), -#endif -#if defined (ESRMNT) - ENTRY(ESRMNT, "ESRMNT", "Srmount error"), -#endif -#if defined (ECOMM) - ENTRY(ECOMM, "ECOMM", "Communication error on send"), -#endif -#if defined (EPROTO) - ENTRY(EPROTO, "EPROTO", "Protocol error"), -#endif -#if defined (EMULTIHOP) - ENTRY(EMULTIHOP, "EMULTIHOP", "Multihop attempted"), -#endif -#if defined (EDOTDOT) - ENTRY(EDOTDOT, "EDOTDOT", "RFS specific error"), -#endif -#if defined (EBADMSG) - ENTRY(EBADMSG, "EBADMSG", "Not a data message"), -#endif -#if defined (ENAMETOOLONG) - ENTRY(ENAMETOOLONG, "ENAMETOOLONG", "File name too long"), -#endif -#if defined (EOVERFLOW) - ENTRY(EOVERFLOW, "EOVERFLOW", "Value too large for defined data type"), -#endif -#if defined (ENOTUNIQ) - ENTRY(ENOTUNIQ, "ENOTUNIQ", "Name not unique on network"), -#endif -#if defined (EBADFD) - ENTRY(EBADFD, "EBADFD", "File descriptor in bad state"), -#endif -#if defined (EREMCHG) - ENTRY(EREMCHG, "EREMCHG", "Remote address changed"), -#endif -#if defined (ELIBACC) - ENTRY(ELIBACC, "ELIBACC", "Can not access a needed shared library"), -#endif -#if defined (ELIBBAD) - ENTRY(ELIBBAD, "ELIBBAD", "Accessing a corrupted shared library"), -#endif -#if defined (ELIBSCN) - ENTRY(ELIBSCN, "ELIBSCN", ".lib section in a.out corrupted"), -#endif -#if defined (ELIBMAX) - ENTRY(ELIBMAX, "ELIBMAX", "Attempting to link in too many shared libraries"), -#endif -#if defined (ELIBEXEC) - ENTRY(ELIBEXEC, "ELIBEXEC", "Cannot exec a shared library directly"), -#endif -#if defined (EILSEQ) - ENTRY(EILSEQ, "EILSEQ", "Illegal byte sequence"), -#endif -#if defined (ENOSYS) - ENTRY(ENOSYS, "ENOSYS", "Operation not applicable"), -#endif -#if defined (ELOOP) - ENTRY(ELOOP, "ELOOP", "Too many symbolic links encountered"), -#endif -#if defined (ERESTART) - ENTRY(ERESTART, "ERESTART", "Interrupted system call should be restarted"), -#endif -#if defined (ESTRPIPE) - ENTRY(ESTRPIPE, "ESTRPIPE", "Streams pipe error"), -#endif -#if defined (ENOTEMPTY) - ENTRY(ENOTEMPTY, "ENOTEMPTY", "Directory not empty"), -#endif -#if defined (EUSERS) - ENTRY(EUSERS, "EUSERS", "Too many users"), -#endif -#if defined (ENOTSOCK) - ENTRY(ENOTSOCK, "ENOTSOCK", "Socket operation on non-socket"), -#endif -#if defined (EDESTADDRREQ) - ENTRY(EDESTADDRREQ, "EDESTADDRREQ", "Destination address required"), -#endif -#if defined (EMSGSIZE) - ENTRY(EMSGSIZE, "EMSGSIZE", "Message too long"), -#endif -#if defined (EPROTOTYPE) - ENTRY(EPROTOTYPE, "EPROTOTYPE", "Protocol wrong type for socket"), -#endif -#if defined (ENOPROTOOPT) - ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol not available"), -#endif -#if defined (EPROTONOSUPPORT) - ENTRY(EPROTONOSUPPORT, "EPROTONOSUPPORT", "Protocol not supported"), -#endif -#if defined (ESOCKTNOSUPPORT) - ENTRY(ESOCKTNOSUPPORT, "ESOCKTNOSUPPORT", "Socket type not supported"), -#endif -#if defined (EOPNOTSUPP) - ENTRY(EOPNOTSUPP, "EOPNOTSUPP", "Operation not supported on transport endpoint"), -#endif -#if defined (EPFNOSUPPORT) - ENTRY(EPFNOSUPPORT, "EPFNOSUPPORT", "Protocol family not supported"), -#endif -#if defined (EAFNOSUPPORT) - ENTRY(EAFNOSUPPORT, "EAFNOSUPPORT", "Address family not supported by protocol"), -#endif -#if defined (EADDRINUSE) - ENTRY(EADDRINUSE, "EADDRINUSE", "Address already in use"), -#endif -#if defined (EADDRNOTAVAIL) - ENTRY(EADDRNOTAVAIL, "EADDRNOTAVAIL","Cannot assign requested address"), -#endif -#if defined (ENETDOWN) - ENTRY(ENETDOWN, "ENETDOWN", "Network is down"), -#endif -#if defined (ENETUNREACH) - ENTRY(ENETUNREACH, "ENETUNREACH", "Network is unreachable"), -#endif -#if defined (ENETRESET) - ENTRY(ENETRESET, "ENETRESET", "Network dropped connection because of reset"), -#endif -#if defined (ECONNABORTED) - ENTRY(ECONNABORTED, "ECONNABORTED", "Software caused connection abort"), -#endif -#if defined (ECONNRESET) - ENTRY(ECONNRESET, "ECONNRESET", "Connection reset by peer"), -#endif -#if defined (ENOBUFS) - ENTRY(ENOBUFS, "ENOBUFS", "No buffer space available"), -#endif -#if defined (EISCONN) - ENTRY(EISCONN, "EISCONN", "Transport endpoint is already connected"), -#endif -#if defined (ENOTCONN) - ENTRY(ENOTCONN, "ENOTCONN", "Transport endpoint is not connected"), -#endif -#if defined (ESHUTDOWN) - ENTRY(ESHUTDOWN, "ESHUTDOWN", "Cannot send after transport endpoint shutdown"), -#endif -#if defined (ETOOMANYREFS) - ENTRY(ETOOMANYREFS, "ETOOMANYREFS", "Too many references: cannot splice"), -#endif -#if defined (ETIMEDOUT) - ENTRY(ETIMEDOUT, "ETIMEDOUT", "Connection timed out"), -#endif -#if defined (ECONNREFUSED) - ENTRY(ECONNREFUSED, "ECONNREFUSED", "Connection refused"), -#endif -#if defined (EHOSTDOWN) - ENTRY(EHOSTDOWN, "EHOSTDOWN", "Host is down"), -#endif -#if defined (EHOSTUNREACH) - ENTRY(EHOSTUNREACH, "EHOSTUNREACH", "No route to host"), -#endif -#if defined (EALREADY) - ENTRY(EALREADY, "EALREADY", "Operation already in progress"), -#endif -#if defined (EINPROGRESS) - ENTRY(EINPROGRESS, "EINPROGRESS", "Operation now in progress"), -#endif -#if defined (ESTALE) - ENTRY(ESTALE, "ESTALE", "Stale NFS file handle"), -#endif -#if defined (EUCLEAN) - ENTRY(EUCLEAN, "EUCLEAN", "Structure needs cleaning"), -#endif -#if defined (ENOTNAM) - ENTRY(ENOTNAM, "ENOTNAM", "Not a XENIX named type file"), -#endif -#if defined (ENAVAIL) - ENTRY(ENAVAIL, "ENAVAIL", "No XENIX semaphores available"), -#endif -#if defined (EISNAM) - ENTRY(EISNAM, "EISNAM", "Is a named type file"), -#endif -#if defined (EREMOTEIO) - ENTRY(EREMOTEIO, "EREMOTEIO", "Remote I/O error"), -#endif - ENTRY(0, NULL, NULL) -}; - -#ifdef EVMSERR -/* This is not in the table, because the numeric value of EVMSERR (32767) - lies outside the range of sys_errlist[]. */ -static struct { int value; const char *name, *msg; } - evmserr = { EVMSERR, "EVMSERR", "VMS-specific error" }; -#endif - -/* Translation table allocated and initialized at runtime. Indexed by the - errno value to find the equivalent symbolic value. */ - -static const char **error_names; -static int num_error_names = 0; - -/* Translation table allocated and initialized at runtime, if it does not - already exist in the host environment. Indexed by the errno value to find - the descriptive string. - - We don't export it for use in other modules because even though it has the - same name, it differs from other implementations in that it is dynamically - initialized rather than statically initialized. */ - -#ifndef HAVE_SYS_ERRLIST - -static int sys_nerr; -static const char **sys_errlist; - -#else - -extern int sys_nerr; -extern char *sys_errlist[]; - -#endif - - -/* - -NAME - - init_error_tables -- initialize the name and message tables - -SYNOPSIS - - static void init_error_tables (); - -DESCRIPTION - - Using the error_table, which is initialized at compile time, generate - the error_names and the sys_errlist (if needed) tables, which are - indexed at runtime by a specific errno value. - -BUGS - - The initialization of the tables may fail under low memory conditions, - in which case we don't do anything particularly useful, but we don't - bomb either. Who knows, it might succeed at a later point if we free - some memory in the meantime. In any case, the other routines know - how to deal with lack of a table after trying to initialize it. This - may or may not be considered to be a bug, that we don't specifically - warn about this particular failure mode. - -*/ - -static void -init_error_tables () -{ - const struct error_info *eip; - int nbytes; - - /* If we haven't already scanned the error_table once to find the maximum - errno value, then go find it now. */ - - if (num_error_names == 0) - { - for (eip = error_table; eip -> name != NULL; eip++) - { - if (eip -> value >= num_error_names) - { - num_error_names = eip -> value + 1; - } - } - } - - /* Now attempt to allocate the error_names table, zero it out, and then - initialize it from the statically initialized error_table. */ - - if (error_names == NULL) - { - nbytes = num_error_names * sizeof (char *); - if ((error_names = (const char **) malloc (nbytes)) != NULL) - { - memset (error_names, 0, nbytes); - for (eip = error_table; eip -> name != NULL; eip++) - { - error_names[eip -> value] = eip -> name; - } - } - } - -#ifndef HAVE_SYS_ERRLIST - - /* Now attempt to allocate the sys_errlist table, zero it out, and then - initialize it from the statically initialized error_table. */ - - if (sys_errlist == NULL) - { - nbytes = num_error_names * sizeof (char *); - if ((sys_errlist = (const char **) malloc (nbytes)) != NULL) - { - memset (sys_errlist, 0, nbytes); - sys_nerr = num_error_names; - for (eip = error_table; eip -> name != NULL; eip++) - { - sys_errlist[eip -> value] = eip -> msg; - } - } - } - -#endif - -} - -/* - -NAME - - errno_max -- return the max errno value - -SYNOPSIS - - int errno_max (); - -DESCRIPTION - - Returns the maximum errno value for which a corresponding symbolic - name or message is available. Note that in the case where - we use the sys_errlist supplied by the system, it is possible for - there to be more symbolic names than messages, or vice versa. - In fact, the manual page for perror(3C) explicitly warns that one - should check the size of the table (sys_nerr) before indexing it, - since new error codes may be added to the system before they are - added to the table. Thus sys_nerr might be smaller than value - implied by the largest errno value defined in <errno.h>. - - We return the maximum value that can be used to obtain a meaningful - symbolic name or message. - -*/ - -int -errno_max () -{ - int maxsize; - - if (error_names == NULL) - { - init_error_tables (); - } - maxsize = MAX (sys_nerr, num_error_names); - return (maxsize - 1); -} - -#ifndef HAVE_STRERROR - -/* - -NAME - - strerror -- map an error number to an error message string - -SYNOPSIS - - char *strerror (int errnoval) - -DESCRIPTION - - Maps an errno number to an error message string, the contents of - which are implementation defined. On systems which have the external - variables sys_nerr and sys_errlist, these strings will be the same - as the ones used by perror(). - - If the supplied error number is within the valid range of indices - for the sys_errlist, but no message is available for the particular - error number, then returns the string "Error NUM", where NUM is the - error number. - - If the supplied error number is not a valid index into sys_errlist, - returns NULL. - - The returned string is only guaranteed to be valid only until the - next call to strerror. - -*/ - -char * -strerror (errnoval) - int errnoval; -{ - char *msg; - static char buf[32]; - -#ifndef HAVE_SYS_ERRLIST - - if (error_names == NULL) - { - init_error_tables (); - } - -#endif - - if ((errnoval < 0) || (errnoval >= sys_nerr)) - { -#ifdef EVMSERR - if (errnoval == evmserr.value) - msg = evmserr.msg; - else -#endif - /* Out of range, just return NULL */ - msg = NULL; - } - else if ((sys_errlist == NULL) || (sys_errlist[errnoval] == NULL)) - { - /* In range, but no sys_errlist or no entry at this index. */ - snprintf (buf, sizeof buf, "Error %d", errnoval); - msg = buf; - } - else - { - /* In range, and a valid message. Just return the message. */ - msg = (char *) sys_errlist[errnoval]; - } - - return (msg); -} - -#endif /* ! HAVE_STRERROR */ - - -/* - -NAME - - strerrno -- map an error number to a symbolic name string - -SYNOPSIS - - const char *strerrno (int errnoval) - -DESCRIPTION - - Given an error number returned from a system call (typically - returned in errno), returns a pointer to a string containing the - symbolic name of that error number, as found in <errno.h>. - - If the supplied error number is within the valid range of indices - for symbolic names, but no name is available for the particular - error number, then returns the string "Error NUM", where NUM is - the error number. - - If the supplied error number is not within the range of valid - indices, then returns NULL. - -BUGS - - The contents of the location pointed to are only guaranteed to be - valid until the next call to strerrno. - -*/ - -const char * -strerrno (errnoval) - int errnoval; -{ - const char *name; - static char buf[32]; - - if (error_names == NULL) - { - init_error_tables (); - } - - if ((errnoval < 0) || (errnoval >= num_error_names)) - { -#ifdef EVMSERR - if (errnoval == evmserr.value) - name = evmserr.name; - else -#endif - /* Out of range, just return NULL */ - name = NULL; - } - else if ((error_names == NULL) || (error_names[errnoval] == NULL)) - { - /* In range, but no error_names or no entry at this index. */ - snprintf (buf, sizeof buf, "Error %d", errnoval); - name = (const char *) buf; - } - else - { - /* In range, and a valid name. Just return the name. */ - name = error_names[errnoval]; - } - - return (name); -} - -/* - -NAME - - strtoerrno -- map a symbolic errno name to a numeric value - -SYNOPSIS - - int strtoerrno (char *name) - -DESCRIPTION - - Given the symbolic name of a error number, map it to an errno value. - If no translation is found, returns 0. - -*/ - -int -strtoerrno (name) - const char *name; -{ - int errnoval = 0; - - if (name != NULL) - { - if (error_names == NULL) - { - init_error_tables (); - } - for (errnoval = 0; errnoval < num_error_names; errnoval++) - { - if ((error_names[errnoval] != NULL) && - (strcmp (name, error_names[errnoval]) == 0)) - { - break; - } - } - if (errnoval == num_error_names) - { -#ifdef EVMSERR - if (strcmp (name, evmserr.name) == 0) - errnoval = evmserr.value; - else -#endif - errnoval = 0; - } - } - return (errnoval); -} - - -/* A simple little main that does nothing but print all the errno translations - if MAIN is defined and this file is compiled and linked. */ - -#ifdef MAIN - -#include <stdio.h> - -int -main () -{ - int errn; - int errnmax; - const char *name; - char *msg; - char *strerror (); - - errnmax = errno_max (); - printf ("%d entries in names table.\n", num_error_names); - printf ("%d entries in messages table.\n", sys_nerr); - printf ("%d is max useful index.\n", errnmax); - - /* Keep printing values until we get to the end of *both* tables, not - *either* table. Note that knowing the maximum useful index does *not* - relieve us of the responsibility of testing the return pointer for - NULL. */ - - for (errn = 0; errn <= errnmax; errn++) - { - name = strerrno (errn); - name = (name == NULL) ? "<NULL>" : name; - msg = strerror (errn); - msg = (msg == NULL) ? "<NULL>" : msg; - printf ("%-4d%-18s%s\n", errn, name, msg); - } - - return 0; -} - -#endif diff --git a/gnu/egcs/libiberty/strncasecmp.c b/gnu/egcs/libiberty/strncasecmp.c deleted file mode 100644 index 4485cac7a6a..00000000000 --- a/gnu/egcs/libiberty/strncasecmp.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1987 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of California at Berkeley. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific written prior permission. This software - * is provided ``as is'' without express or implied warranty. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; -#endif /* LIBC_SCCS and not lint */ - -#include <ansidecl.h> -#ifdef __STDC__ -#include <stddef.h> -#else -#define size_t unsigned long -#endif - -/* - * This array is designed for mapping upper and lower case letter - * together for a case independent comparison. The mappings are - * based upon ascii character sequences. - */ -static unsigned char charmap[] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\300', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\333', '\334', '\335', '\336', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', -}; - -int -strncasecmp(s1, s2, n) - const char *s1, *s2; - register size_t n; -{ - register unsigned char u1, u2; - - for (; n != 0; --n) { - u1 = (unsigned char) *s1++; - u2 = (unsigned char) *s2++; - if (charmap[u1] != charmap[u2]) { - return charmap[u1] - charmap[u2]; - } - if (u1 == '\0') { - return 0; - } - } - return 0; -} diff --git a/gnu/egcs/libiberty/strncmp.c b/gnu/egcs/libiberty/strncmp.c deleted file mode 100644 index b3b9de16b10..00000000000 --- a/gnu/egcs/libiberty/strncmp.c +++ /dev/null @@ -1,28 +0,0 @@ -/* strncmp -- compare two strings, stop after n bytes. - This function is in the public domain. */ - -#include <ansidecl.h> -#ifdef __STDC__ -#include <stddef.h> -#else -#define size_t unsigned long -#endif - -int -strncmp(s1, s2, n) - const char *s1, *s2; - register size_t n; -{ - register unsigned char u1, u2; - - while (n-- > 0) - { - u1 = (unsigned char) *s1++; - u2 = (unsigned char) *s2++; - if (u1 != u2) - return u1 - u2; - if (u1 == '\0') - return 0; - } - return 0; -} diff --git a/gnu/egcs/libiberty/strrchr.c b/gnu/egcs/libiberty/strrchr.c deleted file mode 100644 index 8c05bcbead8..00000000000 --- a/gnu/egcs/libiberty/strrchr.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Portable version of strrchr(). - This function is in the public domain. */ - -/* -NAME - strrchr -- return pointer to last occurance of a character - -SYNOPSIS - char *strrchr (const char *s, int c) - -DESCRIPTION - Returns a pointer to the last occurance of character C in - string S, or a NULL pointer if no occurance is found. - -BUGS - Behavior when character is the null character is implementation - dependent. -*/ - -#include <ansidecl.h> - -char * -strrchr (s, c) - register const char *s; - int c; -{ - char *rtnval = 0; - - do { - if (*s == c) - rtnval = (char*) s; - } while (*s++); - return (rtnval); -} diff --git a/gnu/egcs/libiberty/strsignal.c b/gnu/egcs/libiberty/strsignal.c deleted file mode 100644 index c7bb10c441c..00000000000 --- a/gnu/egcs/libiberty/strsignal.c +++ /dev/null @@ -1,644 +0,0 @@ -/* Extended support for using signal values. - Written by Fred Fish. fnf@cygnus.com - This file is in the public domain. */ - -#include "ansidecl.h" -#include "libiberty.h" - -#include "config.h" - -/* We need to declare sys_siglist, because even if the system provides - it we can't assume that it is declared in <signal.h> (for example, - SunOS provides sys_siglist, but it does not declare it in any - header file). fHowever, we can't declare sys_siglist portably, - because on some systems it is declared with const and on some - systems it is declared without const. If we were using autoconf, - we could work out the right declaration. Until, then we just - ignore any declaration in the system header files, and always - declare it ourselves. With luck, this will always work. */ -#define sys_siglist no_such_symbol - -#include <stdio.h> -#include <signal.h> - -/* Routines imported from standard C runtime libraries. */ - -#ifdef __STDC__ -#include <stddef.h> -extern void *malloc (size_t size); /* 4.10.3.3 */ -extern void *memset (void *s, int c, size_t n); /* 4.11.6.1 */ -#else /* !__STDC__ */ -extern char *malloc (); /* Standard memory allocater */ -extern char *memset (); -#endif /* __STDC__ */ - -/* Undefine the macro we used to hide the definition of sys_siglist - found in the system header files. */ -#undef sys_siglist - -#ifndef NULL -# ifdef __STDC__ -# define NULL (void *) 0 -# else -# define NULL 0 -# endif -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - -static void init_signal_tables PARAMS ((void)); - -/* Translation table for signal values. - - Note that this table is generally only accessed when it is used at runtime - to initialize signal name and message tables that are indexed by signal - value. - - Not all of these signals will exist on all systems. This table is the only - thing that should have to be updated as new signal numbers are introduced. - It's sort of ugly, but at least its portable. */ - -struct signal_info -{ - int value; /* The numeric value from <signal.h> */ - const char *name; /* The equivalent symbolic value */ -#ifndef HAVE_SYS_SIGLIST - const char *msg; /* Short message about this value */ -#endif -}; - -#ifndef HAVE_SYS_SIGLIST -# define ENTRY(value, name, msg) {value, name, msg} -#else -# define ENTRY(value, name, msg) {value, name} -#endif - -static const struct signal_info signal_table[] = -{ -#if defined (SIGHUP) - ENTRY(SIGHUP, "SIGHUP", "Hangup"), -#endif -#if defined (SIGINT) - ENTRY(SIGINT, "SIGINT", "Interrupt"), -#endif -#if defined (SIGQUIT) - ENTRY(SIGQUIT, "SIGQUIT", "Quit"), -#endif -#if defined (SIGILL) - ENTRY(SIGILL, "SIGILL", "Illegal instruction"), -#endif -#if defined (SIGTRAP) - ENTRY(SIGTRAP, "SIGTRAP", "Trace/breakpoint trap"), -#endif -/* Put SIGIOT before SIGABRT, so that if SIGIOT==SIGABRT then SIGABRT - overrides SIGIOT. SIGABRT is in ANSI and POSIX.1, and SIGIOT isn't. */ -#if defined (SIGIOT) - ENTRY(SIGIOT, "SIGIOT", "IOT trap"), -#endif -#if defined (SIGABRT) - ENTRY(SIGABRT, "SIGABRT", "Aborted"), -#endif -#if defined (SIGEMT) - ENTRY(SIGEMT, "SIGEMT", "Emulation trap"), -#endif -#if defined (SIGFPE) - ENTRY(SIGFPE, "SIGFPE", "Arithmetic exception"), -#endif -#if defined (SIGKILL) - ENTRY(SIGKILL, "SIGKILL", "Killed"), -#endif -#if defined (SIGBUS) - ENTRY(SIGBUS, "SIGBUS", "Bus error"), -#endif -#if defined (SIGSEGV) - ENTRY(SIGSEGV, "SIGSEGV", "Segmentation fault"), -#endif -#if defined (SIGSYS) - ENTRY(SIGSYS, "SIGSYS", "Bad system call"), -#endif -#if defined (SIGPIPE) - ENTRY(SIGPIPE, "SIGPIPE", "Broken pipe"), -#endif -#if defined (SIGALRM) - ENTRY(SIGALRM, "SIGALRM", "Alarm clock"), -#endif -#if defined (SIGTERM) - ENTRY(SIGTERM, "SIGTERM", "Terminated"), -#endif -#if defined (SIGUSR1) - ENTRY(SIGUSR1, "SIGUSR1", "User defined signal 1"), -#endif -#if defined (SIGUSR2) - ENTRY(SIGUSR2, "SIGUSR2", "User defined signal 2"), -#endif -/* Put SIGCLD before SIGCHLD, so that if SIGCLD==SIGCHLD then SIGCHLD - overrides SIGCLD. SIGCHLD is in POXIX.1 */ -#if defined (SIGCLD) - ENTRY(SIGCLD, "SIGCLD", "Child status changed"), -#endif -#if defined (SIGCHLD) - ENTRY(SIGCHLD, "SIGCHLD", "Child status changed"), -#endif -#if defined (SIGPWR) - ENTRY(SIGPWR, "SIGPWR", "Power fail/restart"), -#endif -#if defined (SIGWINCH) - ENTRY(SIGWINCH, "SIGWINCH", "Window size changed"), -#endif -#if defined (SIGURG) - ENTRY(SIGURG, "SIGURG", "Urgent I/O condition"), -#endif -#if defined (SIGIO) - /* "I/O pending" has also been suggested, but is misleading since the - signal only happens when the process has asked for it, not everytime - I/O is pending. */ - ENTRY(SIGIO, "SIGIO", "I/O possible"), -#endif -#if defined (SIGPOLL) - ENTRY(SIGPOLL, "SIGPOLL", "Pollable event occurred"), -#endif -#if defined (SIGSTOP) - ENTRY(SIGSTOP, "SIGSTOP", "Stopped (signal)"), -#endif -#if defined (SIGTSTP) - ENTRY(SIGTSTP, "SIGTSTP", "Stopped (user)"), -#endif -#if defined (SIGCONT) - ENTRY(SIGCONT, "SIGCONT", "Continued"), -#endif -#if defined (SIGTTIN) - ENTRY(SIGTTIN, "SIGTTIN", "Stopped (tty input)"), -#endif -#if defined (SIGTTOU) - ENTRY(SIGTTOU, "SIGTTOU", "Stopped (tty output)"), -#endif -#if defined (SIGVTALRM) - ENTRY(SIGVTALRM, "SIGVTALRM", "Virtual timer expired"), -#endif -#if defined (SIGPROF) - ENTRY(SIGPROF, "SIGPROF", "Profiling timer expired"), -#endif -#if defined (SIGXCPU) - ENTRY(SIGXCPU, "SIGXCPU", "CPU time limit exceeded"), -#endif -#if defined (SIGXFSZ) - ENTRY(SIGXFSZ, "SIGXFSZ", "File size limit exceeded"), -#endif -#if defined (SIGWIND) - ENTRY(SIGWIND, "SIGWIND", "SIGWIND"), -#endif -#if defined (SIGPHONE) - ENTRY(SIGPHONE, "SIGPHONE", "SIGPHONE"), -#endif -#if defined (SIGLOST) - ENTRY(SIGLOST, "SIGLOST", "Resource lost"), -#endif -#if defined (SIGWAITING) - ENTRY(SIGWAITING, "SIGWAITING", "Process's LWPs are blocked"), -#endif -#if defined (SIGLWP) - ENTRY(SIGLWP, "SIGLWP", "Signal LWP"), -#endif -#if defined (SIGDANGER) - ENTRY(SIGDANGER, "SIGDANGER", "Swap space dangerously low"), -#endif -#if defined (SIGGRANT) - ENTRY(SIGGRANT, "SIGGRANT", "Monitor mode granted"), -#endif -#if defined (SIGRETRACT) - ENTRY(SIGRETRACT, "SIGRETRACT", "Need to relinguish monitor mode"), -#endif -#if defined (SIGMSG) - ENTRY(SIGMSG, "SIGMSG", "Monitor mode data available"), -#endif -#if defined (SIGSOUND) - ENTRY(SIGSOUND, "SIGSOUND", "Sound completed"), -#endif -#if defined (SIGSAK) - ENTRY(SIGSAK, "SIGSAK", "Secure attention"), -#endif - ENTRY(0, NULL, NULL) -}; - -/* Translation table allocated and initialized at runtime. Indexed by the - signal value to find the equivalent symbolic value. */ - -static const char **signal_names; -static int num_signal_names = 0; - -/* Translation table allocated and initialized at runtime, if it does not - already exist in the host environment. Indexed by the signal value to find - the descriptive string. - - We don't export it for use in other modules because even though it has the - same name, it differs from other implementations in that it is dynamically - initialized rather than statically initialized. */ - -#ifndef HAVE_SYS_SIGLIST - -static int sys_nsig; -static const char **sys_siglist; - -#else - -#ifdef NSIG -static int sys_nsig = NSIG; -#else -#ifdef _NSIG -static int sys_nsig = _NSIG; -#endif -#endif -extern const char * const sys_siglist[]; - -#endif - - -/* - -NAME - - init_signal_tables -- initialize the name and message tables - -SYNOPSIS - - static void init_signal_tables (); - -DESCRIPTION - - Using the signal_table, which is initialized at compile time, generate - the signal_names and the sys_siglist (if needed) tables, which are - indexed at runtime by a specific signal value. - -BUGS - - The initialization of the tables may fail under low memory conditions, - in which case we don't do anything particularly useful, but we don't - bomb either. Who knows, it might succeed at a later point if we free - some memory in the meantime. In any case, the other routines know - how to deal with lack of a table after trying to initialize it. This - may or may not be considered to be a bug, that we don't specifically - warn about this particular failure mode. - -*/ - -static void -init_signal_tables () -{ - const struct signal_info *eip; - int nbytes; - - /* If we haven't already scanned the signal_table once to find the maximum - signal value, then go find it now. */ - - if (num_signal_names == 0) - { - for (eip = signal_table; eip -> name != NULL; eip++) - { - if (eip -> value >= num_signal_names) - { - num_signal_names = eip -> value + 1; - } - } - } - - /* Now attempt to allocate the signal_names table, zero it out, and then - initialize it from the statically initialized signal_table. */ - - if (signal_names == NULL) - { - nbytes = num_signal_names * sizeof (char *); - if ((signal_names = (const char **) malloc (nbytes)) != NULL) - { - memset (signal_names, 0, nbytes); - for (eip = signal_table; eip -> name != NULL; eip++) - { - signal_names[eip -> value] = eip -> name; - } - } - } - -#ifndef HAVE_SYS_SIGLIST - - /* Now attempt to allocate the sys_siglist table, zero it out, and then - initialize it from the statically initialized signal_table. */ - - if (sys_siglist == NULL) - { - nbytes = num_signal_names * sizeof (char *); - if ((sys_siglist = (const char **) malloc (nbytes)) != NULL) - { - memset (sys_siglist, 0, nbytes); - sys_nsig = num_signal_names; - for (eip = signal_table; eip -> name != NULL; eip++) - { - sys_siglist[eip -> value] = eip -> msg; - } - } - } - -#endif - -} - - -/* - -NAME - - signo_max -- return the max signo value - -SYNOPSIS - - int signo_max (); - -DESCRIPTION - - Returns the maximum signo value for which a corresponding symbolic - name or message is available. Note that in the case where - we use the sys_siglist supplied by the system, it is possible for - there to be more symbolic names than messages, or vice versa. - In fact, the manual page for psignal(3b) explicitly warns that one - should check the size of the table (NSIG) before indexing it, - since new signal codes may be added to the system before they are - added to the table. Thus NSIG might be smaller than value - implied by the largest signo value defined in <signal.h>. - - We return the maximum value that can be used to obtain a meaningful - symbolic name or message. - -*/ - -int -signo_max () -{ - int maxsize; - - if (signal_names == NULL) - { - init_signal_tables (); - } - maxsize = MAX (sys_nsig, num_signal_names); - return (maxsize - 1); -} - - -/* - -NAME - - strsignal -- map a signal number to a signal message string - -SYNOPSIS - - const char *strsignal (int signo) - -DESCRIPTION - - Maps an signal number to an signal message string, the contents of - which are implementation defined. On systems which have the external - variable sys_siglist, these strings will be the same as the ones used - by psignal(). - - If the supplied signal number is within the valid range of indices - for the sys_siglist, but no message is available for the particular - signal number, then returns the string "Signal NUM", where NUM is the - signal number. - - If the supplied signal number is not a valid index into sys_siglist, - returns NULL. - - The returned string is only guaranteed to be valid only until the - next call to strsignal. - -*/ - -#ifndef HAVE_STRSIGNAL - -const char * -strsignal (signo) - int signo; -{ - const char *msg; - static char buf[32]; - -#ifndef HAVE_SYS_SIGLIST - - if (signal_names == NULL) - { - init_signal_tables (); - } - -#endif - - if ((signo < 0) || (signo >= sys_nsig)) - { - /* Out of range, just return NULL */ - msg = NULL; - } - else if ((sys_siglist == NULL) || (sys_siglist[signo] == NULL)) - { - /* In range, but no sys_siglist or no entry at this index. */ - sprintf (buf, "Signal %d", signo); - msg = (const char *) buf; - } - else - { - /* In range, and a valid message. Just return the message. */ - msg = (const char *) sys_siglist[signo]; - } - - return (msg); -} - -#endif /* ! HAVE_STRSIGNAL */ - -/* - -NAME - - strsigno -- map an signal number to a symbolic name string - -SYNOPSIS - - const char *strsigno (int signo) - -DESCRIPTION - - Given an signal number, returns a pointer to a string containing - the symbolic name of that signal number, as found in <signal.h>. - - If the supplied signal number is within the valid range of indices - for symbolic names, but no name is available for the particular - signal number, then returns the string "Signal NUM", where NUM is - the signal number. - - If the supplied signal number is not within the range of valid - indices, then returns NULL. - -BUGS - - The contents of the location pointed to are only guaranteed to be - valid until the next call to strsigno. - -*/ - -const char * -strsigno (signo) - int signo; -{ - const char *name; - static char buf[32]; - - if (signal_names == NULL) - { - init_signal_tables (); - } - - if ((signo < 0) || (signo >= num_signal_names)) - { - /* Out of range, just return NULL */ - name = NULL; - } - else if ((signal_names == NULL) || (signal_names[signo] == NULL)) - { - /* In range, but no signal_names or no entry at this index. */ - sprintf (buf, "Signal %d", signo); - name = (const char *) buf; - } - else - { - /* In range, and a valid name. Just return the name. */ - name = signal_names[signo]; - } - - return (name); -} - - -/* - -NAME - - strtosigno -- map a symbolic signal name to a numeric value - -SYNOPSIS - - int strtosigno (char *name) - -DESCRIPTION - - Given the symbolic name of a signal, map it to a signal number. - If no translation is found, returns 0. - -*/ - -int -strtosigno (name) - const char *name; -{ - int signo = 0; - - if (name != NULL) - { - if (signal_names == NULL) - { - init_signal_tables (); - } - for (signo = 0; signo < num_signal_names; signo++) - { - if ((signal_names[signo] != NULL) && - (strcmp (name, signal_names[signo]) == 0)) - { - break; - } - } - if (signo == num_signal_names) - { - signo = 0; - } - } - return (signo); -} - - -/* - -NAME - - psignal -- print message about signal to stderr - -SYNOPSIS - - void psignal (unsigned signo, char *message); - -DESCRIPTION - - Print to the standard error the message, followed by a colon, - followed by the description of the signal specified by signo, - followed by a newline. -*/ - -#ifndef HAVE_PSIGNAL - -void -psignal (signo, message) - unsigned signo; - char *message; -{ - if (signal_names == NULL) - { - init_signal_tables (); - } - if ((signo <= 0) || (signo >= sys_nsig)) - { - fprintf (stderr, "%s: unknown signal\n", message); - } - else - { - fprintf (stderr, "%s: %s\n", message, sys_siglist[signo]); - } -} - -#endif /* ! HAVE_PSIGNAL */ - - -/* A simple little main that does nothing but print all the signal translations - if MAIN is defined and this file is compiled and linked. */ - -#ifdef MAIN - -#include <stdio.h> - -int -main () -{ - int signo; - int maxsigno; - const char *name; - const char *msg; - - maxsigno = signo_max (); - printf ("%d entries in names table.\n", num_signal_names); - printf ("%d entries in messages table.\n", sys_nsig); - printf ("%d is max useful index.\n", maxsigno); - - /* Keep printing values until we get to the end of *both* tables, not - *either* table. Note that knowing the maximum useful index does *not* - relieve us of the responsibility of testing the return pointer for - NULL. */ - - for (signo = 0; signo <= maxsigno; signo++) - { - name = strsigno (signo); - name = (name == NULL) ? "<NULL>" : name; - msg = strsignal (signo); - msg = (msg == NULL) ? "<NULL>" : msg; - printf ("%-4d%-18s%s\n", signo, name, msg); - } - - return 0; -} - -#endif diff --git a/gnu/egcs/libiberty/strstr.c b/gnu/egcs/libiberty/strstr.c deleted file mode 100644 index fab36e3fb3d..00000000000 --- a/gnu/egcs/libiberty/strstr.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Simple implementation of strstr for systems without it. - This function is in the public domain. */ - -/* - -NAME - - strstr -- locate first occurance of a substring - -SYNOPSIS - - #include <string.h> - - char *strstr (char *s1, char *s2) - -DESCRIPTION - - Locates the first occurance in the string pointed to by S1 of - the string pointed to by S2. Returns a pointer to the substring - found, or a NULL pointer if not found. If S2 points to a string - with zero length, the function returns S1. - -BUGS - -*/ - - -/* FIXME: The above description is ANSI compiliant. This routine has not - been validated to comply with it. -fnf */ - -char * -strstr (s1, s2) - char *s1, *s2; -{ - register char *p = s1; - extern char *strchr (); - extern int strncmp (); -#if __GNUC__==2 - extern __SIZE_TYPE__ strlen (); -#endif - register int len = strlen (s2); - - for (; (p = strchr (p, *s2)) != 0; p++) - { - if (strncmp (p, s2, len) == 0) - { - return (p); - } - } - return (0); -} diff --git a/gnu/egcs/libiberty/strtod.c b/gnu/egcs/libiberty/strtod.c deleted file mode 100644 index c86c73de9b3..00000000000 --- a/gnu/egcs/libiberty/strtod.c +++ /dev/null @@ -1,122 +0,0 @@ -/* Implementation of strtod for systems with atof. - Copyright (C) 1991, 1995 Free Software Foundation, Inc. - -This file is part of the libiberty library. This library is free -software; you can redistribute it and/or modify it under the -terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) -any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -As a special exception, if you link this library with files -compiled with a GNU compiler to produce an executable, this does not cause -the resulting executable to be covered by the GNU General Public License. -This exception does not however invalidate any other reasons why -the executable file might be covered by the GNU General Public License. */ - -#include <ctype.h> - -extern double atof (); - -/* Disclaimer: this is currently just used by CHILL in GDB and therefore - has not been tested well. It may have been tested for nothing except - that it compiles. */ - -double -strtod (str, ptr) - char *str; - char **ptr; -{ - char *p; - - if (ptr == (char **)0) - return atof (str); - - p = str; - - while (isspace (*p)) - ++p; - - if (*p == '+' || *p == '-') - ++p; - - /* INF or INFINITY. */ - if ((p[0] == 'i' || p[0] == 'I') - && (p[1] == 'n' || p[1] == 'N') - && (p[2] == 'f' || p[2] == 'F')) - { - if ((p[3] == 'i' || p[3] == 'I') - && (p[4] == 'n' || p[4] == 'N') - && (p[5] == 'i' || p[5] == 'I') - && (p[6] == 't' || p[6] == 'T') - && (p[7] == 'y' || p[7] == 'Y')) - { - *ptr = p + 7; - return atof (str); - } - else - { - *ptr = p + 3; - return atof (str); - } - } - - /* NAN or NAN(foo). */ - if ((p[0] == 'n' || p[0] == 'N') - && (p[1] == 'a' || p[1] == 'A') - && (p[2] == 'n' || p[2] == 'N')) - { - p += 3; - if (*p == '(') - { - ++p; - while (*p != '\0' && *p != ')') - ++p; - if (*p == ')') - ++p; - } - *ptr = p; - return atof (str); - } - - /* digits, with 0 or 1 periods in it. */ - if (isdigit (*p) || *p == '.') - { - int got_dot = 0; - while (isdigit (*p) || (!got_dot && *p == '.')) - { - if (*p == '.') - got_dot = 1; - ++p; - } - - /* Exponent. */ - if (*p == 'e' || *p == 'E') - { - int i; - i = 1; - if (p[i] == '+' || p[i] == '-') - ++i; - if (isdigit (p[i])) - { - while (isdigit (p[i])) - ++i; - *ptr = p + i; - return atof (str); - } - } - *ptr = p; - return atof (str); - } - /* Didn't find any digits. Doesn't look like a number. */ - *ptr = str; - return 0.0; -} diff --git a/gnu/egcs/libiberty/strtol.c b/gnu/egcs/libiberty/strtol.c deleted file mode 100644 index 5467cc3e2e9..00000000000 --- a/gnu/egcs/libiberty/strtol.c +++ /dev/null @@ -1,140 +0,0 @@ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. [rescinded 22 July 1999] - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <limits.h> -#include <ctype.h> -#include <errno.h> -#if 0 -#include <stdlib.h> -#endif -#include "ansidecl.h" - -/* FIXME: It'd be nice to configure around these, but the include files are too - painful. These macros should at least be more portable than hardwired hex - constants. */ - -#ifndef ULONG_MAX -#define ULONG_MAX ((unsigned long)(~0L)) /* 0xFFFFFFFF */ -#endif - -#ifndef LONG_MAX -#define LONG_MAX ((long)(ULONG_MAX >> 1)) /* 0x7FFFFFFF */ -#endif - -#ifndef LONG_MIN -#define LONG_MIN ((long)(~LONG_MAX)) /* 0x80000000 */ -#endif - -/* - * Convert a string to a long integer. - * - * Ignores `locale' stuff. Assumes that the upper and lower case - * alphabets and digits are each contiguous. - */ -long -strtol(nptr, endptr, base) - const char *nptr; - char **endptr; - register int base; -{ - register const char *s = nptr; - register unsigned long acc; - register int c; - register unsigned long cutoff; - register int neg = 0, any, cutlim; - - /* - * Skip white space and pick up leading +/- sign if any. - * If base is 0, allow 0x for hex and 0 for octal, else - * assume decimal; if base is already 16, allow 0x. - */ - do { - c = *s++; - } while (isspace(c)); - if (c == '-') { - neg = 1; - c = *s++; - } else if (c == '+') - c = *s++; - if ((base == 0 || base == 16) && - c == '0' && (*s == 'x' || *s == 'X')) { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = c == '0' ? 8 : 10; - - /* - * Compute the cutoff value between legal numbers and illegal - * numbers. That is the largest legal value, divided by the - * base. An input number that is greater than this value, if - * followed by a legal input character, is too big. One that - * is equal to this value may be valid or not; the limit - * between valid and invalid numbers is then based on the last - * digit. For instance, if the range for longs is - * [-2147483648..2147483647] and the input base is 10, - * cutoff will be set to 214748364 and cutlim to either - * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated - * a value > 214748364, or equal but the next digit is > 7 (or 8), - * the number is too big, and we will return a range error. - * - * Set any if any `digits' consumed; make it negative to indicate - * overflow. - */ - cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; - cutlim = cutoff % (unsigned long)base; - cutoff /= (unsigned long)base; - for (acc = 0, any = 0;; c = *s++) { - if (isdigit(c)) - c -= '0'; - else if (isalpha(c)) - c -= isupper(c) ? 'A' - 10 : 'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) - any = -1; - else { - any = 1; - acc *= base; - acc += c; - } - } - if (any < 0) { - acc = neg ? LONG_MIN : LONG_MAX; - errno = ERANGE; - } else if (neg) - acc = -acc; - if (endptr != 0) - *endptr = (char *) (any ? s - 1 : nptr); - return (acc); -} diff --git a/gnu/egcs/libiberty/strtoul.c b/gnu/egcs/libiberty/strtoul.c deleted file mode 100644 index 2ec32043e6b..00000000000 --- a/gnu/egcs/libiberty/strtoul.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. [rescinded 22 July 1999] - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <limits.h> -#include <ctype.h> -#include <errno.h> -#if 0 -#include <stdlib.h> -#endif -#include "ansidecl.h" - -#ifndef ULONG_MAX -#define ULONG_MAX ((unsigned long)(~0L)) /* 0xFFFFFFFF */ -#endif - -/* - * Convert a string to an unsigned long integer. - * - * Ignores `locale' stuff. Assumes that the upper and lower case - * alphabets and digits are each contiguous. - */ -unsigned long -strtoul(nptr, endptr, base) - const char *nptr; - char **endptr; - register int base; -{ - register const char *s = nptr; - register unsigned long acc; - register int c; - register unsigned long cutoff; - register int neg = 0, any, cutlim; - - /* - * See strtol for comments as to the logic used. - */ - do { - c = *s++; - } while (isspace(c)); - if (c == '-') { - neg = 1; - c = *s++; - } else if (c == '+') - c = *s++; - if ((base == 0 || base == 16) && - c == '0' && (*s == 'x' || *s == 'X')) { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = c == '0' ? 8 : 10; - cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; - cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; - for (acc = 0, any = 0;; c = *s++) { - if (isdigit(c)) - c -= '0'; - else if (isalpha(c)) - c -= isupper(c) ? 'A' - 10 : 'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) - any = -1; - else { - any = 1; - acc *= base; - acc += c; - } - } - if (any < 0) { - acc = ULONG_MAX; - errno = ERANGE; - } else if (neg) - acc = -acc; - if (endptr != 0) - *endptr = (char *) (any ? s - 1 : nptr); - return (acc); -} diff --git a/gnu/egcs/libiberty/testsuite/Makefile.in b/gnu/egcs/libiberty/testsuite/Makefile.in deleted file mode 100644 index 9d4ddd0ef1e..00000000000 --- a/gnu/egcs/libiberty/testsuite/Makefile.in +++ /dev/null @@ -1,75 +0,0 @@ -# -# Makefile -# Copyright (C) 1999 -# Free Software Foundation -# -# This file is part of the libiberty library. -# Libiberty is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# Libiberty is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with libiberty; see the file COPYING.LIB. If not, -# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# - -# This file was written by Tom Tromey <tromey@cygnus.com>. - -# -# Makefile for libiberty/testsuite directory -# - -srcdir = @srcdir@ -VPATH = @srcdir@ - -SHELL = @SHELL@ - -CC = @CC@ -CFLAGS = @CFLAGS@ -LIBCFLAGS = $(CFLAGS) - -# Multilib support variables. -MULTISRCTOP = - -INCDIR=$(srcdir)/../$(MULTISRCTOP)../include - -all: - -check: @CHECK@ - -# Run some tests of the demangler. -check-cplus-dem: test-filter $(srcdir)/demangle-expected - $(SHELL) $(srcdir)/regress-demangle $(srcdir)/demangle-expected - -# Note that we just hard-code prepends_underscore to 0. This doesn't -# matter since any particular test can override the default if need -# be. -TEST_COMPILE = $(CC) @DEFS@ $(LIBCFLAGS) -I.. -I$(INCDIR) $(HDEFINES) -test-filter: $(srcdir)/../cplus-dem.c - echo 'int prepends_underscore = 0;' > test-us.c - $(TEST_COMPILE) -o test-filter -DMAIN -DVERSION='"none"' @DEFS@ \ - $(srcdir)/../cplus-dem.c test-us.c -L.. -liberty - - -# Standard (either GNU or Cygnus) rules we don't use. -info install-info clean-info dvi install etags tags installcheck: - -# The standard clean rules. -mostlyclean: - rm -f test-us.c test-filter -clean: mostlyclean -distclean: clean - rm -f Makefile -maintainer-clean realclean: distclean - - -Makefile: $(srcdir)/Makefile.in ../config.status - CONFIG_FILES=testsuite/Makefile CONFIG_HEADERS= \ - cd .. && $(SHELL) ./config.status diff --git a/gnu/egcs/libiberty/testsuite/demangle-expected b/gnu/egcs/libiberty/testsuite/demangle-expected deleted file mode 100644 index d3a1fe43890..00000000000 --- a/gnu/egcs/libiberty/testsuite/demangle-expected +++ /dev/null @@ -1,2488 +0,0 @@ -# This file holds test cases for the demangler. -# Each test consists of three lines in succession. -# The first line is arguments to pass to the test filter program. -# The second line is the mangled string. -# The third line is the expected output. -# A line starting with `#' is ignore. -# However blank lines in this file are NOT ignored. -# ---format=gnu -AddAlignment__9ivTSolverUiP12ivInteractorP7ivTGlue -ivTSolver::AddAlignment(unsigned int, ivInteractor *, ivTGlue *) -# ---format=gnu -ArrowheadIntersects__9ArrowLineP9ArrowheadR6BoxObjP7Graphic -ArrowLine::ArrowheadIntersects(Arrowhead *, BoxObj &, Graphic *) -# ---format=gnu -AtEnd__13ivRubberGroup -ivRubberGroup::AtEnd(void) -# ---format=gnu -BgFilter__9ivTSolverP12ivInteractor -ivTSolver::BgFilter(ivInteractor *) -# ---format=gnu -Check__6UArrayi -UArray::Check(int) -# ---format=gnu -CoreConstDecls__8TextCodeR7ostream -TextCode::CoreConstDecls(ostream &) -# ---format=gnu -Detach__8StateVarP12StateVarView -StateVar::Detach(StateVarView *) -# ---format=gnu -Done__9ComponentG8Iterator -Component::Done(Iterator) -# ---format=gnu -Effect__11RelateManipR7ivEvent -RelateManip::Effect(ivEvent &) -# ---format=gnu -FindFixed__FRP4CNetP4CNet -FindFixed(CNet *&, CNet *) -# ---format=gnu -Fix48_abort__FR8twolongs -Fix48_abort(twolongs &) -# ---format=gnu -GetBarInfo__15iv2_6_VScrollerP13ivPerspectiveRiT2 -iv2_6_VScroller::GetBarInfo(ivPerspective *, int &, int &) -# ---format=gnu -GetBgColor__C9ivPainter -ivPainter::GetBgColor(void) const -# ---format=gnu -InsertBody__15H_PullrightMenuii -H_PullrightMenu::InsertBody(int, int) -# ---format=gnu -InsertCharacter__9TextManipc -TextManip::InsertCharacter(char) -# ---format=gnu -InsertToplevel__7ivWorldP12ivInteractorT1 -ivWorld::InsertToplevel(ivInteractor *, ivInteractor *) -# ---format=gnu -InsertToplevel__7ivWorldP12ivInteractorT1iiUi -ivWorld::InsertToplevel(ivInteractor *, ivInteractor *, int, int, unsigned int) -# ---format=gnu -IsAGroup__FP11GraphicViewP11GraphicComp -IsAGroup(GraphicView *, GraphicComp *) -# ---format=gnu -IsA__10ButtonCodeUl -ButtonCode::IsA(unsigned long) -# ---format=gnu -ReadName__FR7istreamPc -ReadName(istream &, char *) -# ---format=gnu -Redraw__13StringBrowseriiii -StringBrowser::Redraw(int, int, int, int) -# ---format=gnu -Rotate__13ivTransformerf -ivTransformer::Rotate(float) -# ---format=gnu -Rotated__C13ivTransformerf -ivTransformer::Rotated(float) const -# ---format=gnu -Round__Ff -Round(float) -# ---format=gnu -SetExport__16MemberSharedNameUi -MemberSharedName::SetExport(unsigned int) -# ---format=gnu -Set__14ivControlState13ControlStatusUi -ivControlState::Set(ControlStatus, unsigned int) -# ---format=gnu -Set__5DFacePcii -DFace::Set(char *, int, int) -# ---format=gnu -VConvert__9ivTSolverP12ivInteractorRP8TElementT2 -ivTSolver::VConvert(ivInteractor *, TElement *&, TElement *&) -# ---format=gnu -VConvert__9ivTSolverP7ivTGlueRP8TElement -ivTSolver::VConvert(ivTGlue *, TElement *&) -# ---format=gnu -VOrder__9ivTSolverUiRP12ivInteractorT2 -ivTSolver::VOrder(unsigned int, ivInteractor *&, ivInteractor *&) -# ---format=gnu -_10PageButton\$__both -PageButton::__both -# ---format=gnu -_3RNG\$singleMantissa -RNG::singleMantissa -# ---format=gnu -_5IComp\$_release -IComp::_release -# ---format=gnu -_\$_10BitmapComp -BitmapComp::~BitmapComp(void) -# ---format=gnu -_\$_9__io_defs -__io_defs::~__io_defs(void) -# ---format=gnu -_\$_Q23foo3bar -foo::bar::~bar(void) -# ---format=gnu -_\$_Q33foo3bar4bell -foo::bar::bell::~bell(void) -# ---format=gnu -__10ivTelltaleiP7ivGlyph -ivTelltale::ivTelltale(int, ivGlyph *) -# ---format=gnu -__10ivViewportiP12ivInteractorUi -ivViewport::ivViewport(int, ivInteractor *, unsigned int) -# ---format=gnu -__10ostrstream -ostrstream::ostrstream(void) -# ---format=gnu -__10ostrstreamPcii -ostrstream::ostrstream(char *, int, int) -# ---format=gnu -__11BitmapTablei -BitmapTable::BitmapTable(int) -# ---format=gnu -__12ViewportCodeP12ViewportComp -ViewportCode::ViewportCode(ViewportComp *) -# ---format=gnu -__12iv2_6_Borderii -iv2_6_Border::iv2_6_Border(int, int) -# ---format=gnu -__12ivBreak_Listl -ivBreak_List::ivBreak_List(long) -# ---format=gnu -__14iv2_6_MenuItemiP12ivInteractor -iv2_6_MenuItem::iv2_6_MenuItem(int, ivInteractor *) -# ---format=gnu -__20DisplayList_IteratorR11DisplayList -DisplayList_Iterator::DisplayList_Iterator(DisplayList &) -# ---format=gnu -__3fooRT0 -foo::foo(foo &) -# ---format=gnu -__3fooiN31 -foo::foo(int, int, int, int) -# ---format=gnu -__3fooiRT0iT2iT2 -foo::foo(int, foo &, int, foo &, int, foo &) -# ---format=gnu -__6KeyMapPT0 -KeyMap::KeyMap(KeyMap *) -# ---format=gnu -__8ArrowCmdP6EditorUiUi -ArrowCmd::ArrowCmd(Editor *, unsigned int, unsigned int) -# ---format=gnu -__9F_EllipseiiiiP7Graphic -F_Ellipse::F_Ellipse(int, int, int, int, Graphic *) -# ---format=gnu -__9FrameDataP9FrameCompi -FrameData::FrameData(FrameComp *, int) -# ---format=gnu -__9HVGraphicP9CanvasVarP7Graphic -HVGraphic::HVGraphic(CanvasVar *, Graphic *) -# ---format=gnu -__Q23foo3bar -foo::bar::bar(void) -# ---format=gnu -__Q33foo3bar4bell -foo::bar::bell::bell(void) -# ---format=gnu -__aa__3fooRT0 -foo::operator&&(foo &) -# ---format=gnu -__aad__3fooRT0 -foo::operator&=(foo &) -# ---format=gnu -__ad__3fooRT0 -foo::operator&(foo &) -# ---format=gnu -__adv__3fooRT0 -foo::operator/=(foo &) -# ---format=gnu -__aer__3fooRT0 -foo::operator^=(foo &) -# ---format=gnu -__als__3fooRT0 -foo::operator<<=(foo &) -# ---format=gnu -__amd__3fooRT0 -foo::operator%=(foo &) -# ---format=gnu -__ami__3fooRT0 -foo::operator-=(foo &) -# ---format=gnu -__aml__3FixRT0 -Fix::operator*=(Fix &) -# ---format=gnu -__aml__5Fix16i -Fix16::operator*=(int) -# ---format=gnu -__aml__5Fix32RT0 -Fix32::operator*=(Fix32 &) -# ---format=gnu -__aor__3fooRT0 -foo::operator|=(foo &) -# ---format=gnu -__apl__3fooRT0 -foo::operator+=(foo &) -# ---format=gnu -__ars__3fooRT0 -foo::operator>>=(foo &) -# ---format=gnu -__as__3fooRT0 -foo::operator=(foo &) -# ---format=gnu -__cl__3fooRT0 -foo::operator()(foo &) -# ---format=gnu -__cl__6Normal -Normal::operator()(void) -# ---format=gnu -__cl__6Stringii -String::operator()(int, int) -# ---format=gnu -__cm__3fooRT0 -foo::operator, (foo &) -# ---format=gnu -__co__3foo -foo::operator~(void) -# ---format=gnu -__dl__3fooPv -foo::operator delete(void *) -# ---format=gnu -__dv__3fooRT0 -foo::operator/(foo &) -# ---format=gnu -__eq__3fooRT0 -foo::operator==(foo &) -# ---format=gnu -__er__3fooRT0 -foo::operator^(foo &) -# ---format=gnu -__ge__3fooRT0 -foo::operator>=(foo &) -# ---format=gnu -__gt__3fooRT0 -foo::operator>(foo &) -# ---format=gnu -__le__3fooRT0 -foo::operator<=(foo &) -# ---format=gnu -__ls__3fooRT0 -foo::operator<<(foo &) -# ---format=gnu -__ls__FR7ostreamPFR3ios_R3ios -operator<<(ostream &, ios &(*)(ios &)) -# ---format=gnu -__ls__FR7ostreamR3Fix -operator<<(ostream &, Fix &) -# ---format=gnu -__lt__3fooRT0 -foo::operator<(foo &) -# ---format=gnu -__md__3fooRT0 -foo::operator%(foo &) -# ---format=gnu -__mi__3fooRT0 -foo::operator-(foo &) -# ---format=gnu -__ml__3fooRT0 -foo::operator*(foo &) -# ---format=gnu -__mm__3fooi -foo::operator--(int) -# ---format=gnu -__ne__3fooRT0 -foo::operator!=(foo &) -# ---format=gnu -__nt__3foo -foo::operator!(void) -# ---format=gnu -__nw__3fooi -foo::operator new(int) -# ---format=gnu -__oo__3fooRT0 -foo::operator||(foo &) -# ---format=gnu -__opPc__3foo -foo::operator char *(void) -# ---format=gnu -__opi__3foo -foo::operator int(void) -# ---format=gnu -__or__3fooRT0 -foo::operator|(foo &) -# ---format=gnu -__pl__3fooRT0 -foo::operator+(foo &) -# ---format=gnu -__pp__3fooi -foo::operator++(int) -# ---format=gnu -__rf__3foo -foo::operator->(void) -# ---format=gnu -__rm__3fooRT0 -foo::operator->*(foo &) -# ---format=gnu -__rs__3fooRT0 -foo::operator>>(foo &) -# ---format=gnu -_new_Fix__FUs -_new_Fix(unsigned short) -# ---format=gnu -_vt.foo -foo virtual table -# ---format=gnu -_vt.foo.bar -foo::bar virtual table -# ---format=gnu -_vt\$foo -foo virtual table -# ---format=gnu -_vt\$foo\$bar -foo::bar virtual table -# ---format=gnu -append__7ivGlyphPT0 -ivGlyph::append(ivGlyph *) -# ---format=gnu -clearok__FP7_win_sti -clearok(_win_st *, int) -# ---format=gnu -complexfunc2__FPFPc_i -complexfunc2(int (*)(char *)) -# ---format=gnu -complexfunc3__FPFPFPl_s_i -complexfunc3(int (*)(short (*)(long *))) -# ---format=gnu -complexfunc4__FPFPFPc_s_i -complexfunc4(int (*)(short (*)(char *))) -# ---format=gnu -complexfunc5__FPFPc_PFl_i -complexfunc5(int (*(*)(char *))(long)) -# ---format=gnu -complexfunc6__FPFPi_PFl_i -complexfunc6(int (*(*)(int *))(long)) -# ---format=gnu -complexfunc7__FPFPFPc_i_PFl_i -complexfunc7(int (*(*)(int (*)(char *)))(long)) -# ---format=gnu -foo__FiN30 -foo(int, int, int, int) -# ---format=gnu -foo__FiR3fooiT1iT1 -foo(int, foo &, int, foo &, int, foo &) -# ---format=gnu -foo___3barl -bar::foo_(long) -# ---format=gnu -insert__15ivClippingStacklRP8_XRegion -ivClippingStack::insert(long, _XRegion *&) -# ---format=gnu -insert__16ChooserInfo_ListlR11ChooserInfo -ChooserInfo_List::insert(long, ChooserInfo &) -# ---format=gnu -insert__17FontFamilyRepListlRP15ivFontFamilyRep -FontFamilyRepList::insert(long, ivFontFamilyRep *&) -# ---format=gnu -leaveok__FP7_win_stc -leaveok(_win_st *, char) -# ---format=gnu -left_mover__C7ivMFKitP12ivAdjustableP7ivStyle -ivMFKit::left_mover(ivAdjustable *, ivStyle *) const -# ---format=gnu -overload1arg__FSc -overload1arg(signed char) -# ---format=gnu -overload1arg__FUc -overload1arg(unsigned char) -# ---format=gnu -overload1arg__FUi -overload1arg(unsigned int) -# ---format=gnu -overload1arg__FUl -overload1arg(unsigned long) -# ---format=gnu -overload1arg__FUs -overload1arg(unsigned short) -# ---format=gnu -overload1arg__Fc -overload1arg(char) -# ---format=gnu -overload1arg__Fd -overload1arg(double) -# ---format=gnu -overload1arg__Ff -overload1arg(float) -# ---format=gnu -overload1arg__Fi -overload1arg(int) -# ---format=gnu -overload1arg__Fl -overload1arg(long) -# ---format=gnu -overload1arg__Fs -overload1arg(short) -# ---format=gnu -overload1arg__Fv -overload1arg(void) -# ---format=gnu -overloadargs__Fi -overloadargs(int) -# ---format=gnu -overloadargs__Fii -overloadargs(int, int) -# ---format=gnu -overloadargs__Fiii -overloadargs(int, int, int) -# ---format=gnu -overloadargs__Fiiii -overloadargs(int, int, int, int) -# ---format=gnu -overloadargs__Fiiiii -overloadargs(int, int, int, int, int) -# ---format=gnu -overloadargs__Fiiiiii -overloadargs(int, int, int, int, int, int) -# ---format=gnu -overloadargs__Fiiiiiii -overloadargs(int, int, int, int, int, int, int) -# ---format=gnu -overloadargs__Fiiiiiiii -overloadargs(int, int, int, int, int, int, int, int) -# ---format=gnu -overloadargs__Fiiiiiiiii -overloadargs(int, int, int, int, int, int, int, int, int) -# ---format=gnu -overloadargs__Fiiiiiiiiii -overloadargs(int, int, int, int, int, int, int, int, int, int) -# ---format=gnu -overloadargs__Fiiiiiiiiiii -overloadargs(int, int, int, int, int, int, int, int, int, int, int) -# ---format=gnu -poke__8ivRasterUlUlffff -ivRaster::poke(unsigned long, unsigned long, float, float, float, float) -# ---format=gnu -polar__Fdd -polar(double, double) -# ---format=gnu -scale__13ivTransformerff -ivTransformer::scale(float, float) -# ---format=gnu -sgetn__7filebufPci -filebuf::sgetn(char *, int) -# ---format=gnu -shift__FP5_FrepiT0 -shift(_Frep *, int, _Frep *) -# ---format=gnu -test__C6BitSeti -BitSet::test(int) const -# ---format=gnu -test__C6BitSetii -BitSet::test(int, int) const -# ---format=gnu -text_source__8Documentl -Document::text_source(long) -# ---format=gnu -variance__6Erlangd -Erlang::variance(double) -# ---format=gnu -view__14DocumentViewerP8ItemViewP11TabularItem -DocumentViewer::view(ItemView *, TabularItem *) -# ---format=gnu -xy_extents__11ivExtensionffff -ivExtension::xy_extents(float, float, float, float) -# ---format=gnu -zero__8osMemoryPvUi -osMemory::zero(void *, unsigned int) -# ---format=gnu -_2T4\$N -T4::N -# ---format=gnu -_Q22T42t1\$N -T4::t1::N -# ---format=gnu -get__2T1 -T1::get(void) -# ---format=gnu -get__Q22T11a -T1::a::get(void) -# ---format=gnu -get__Q32T11a1b -T1::a::b::get(void) -# ---format=gnu -get__Q42T11a1b1c -T1::a::b::c::get(void) -# ---format=gnu -get__Q52T11a1b1c1d -T1::a::b::c::d::get(void) -# ---format=gnu -put__2T1i -T1::put(int) -# ---format=gnu -put__Q22T11ai -T1::a::put(int) -# ---format=gnu -put__Q32T11a1bi -T1::a::b::put(int) -# ---format=gnu -put__Q42T11a1b1ci -T1::a::b::c::put(int) -# ---format=gnu -put__Q52T11a1b1c1di -T1::a::b::c::d::put(int) -# ---format=gnu -bar__3fooPv -foo::bar(void *) -# ---format=gnu -bar__C3fooPv -foo::bar(void *) const -# ---format=gnu -__eq__3fooRT0 -foo::operator==(foo &) -# ---format=gnu -__eq__C3fooR3foo -foo::operator==(foo &) const -# ---format=gnu -elem__t6vector1Zdi -vector<double>::elem(int) -# ---format=gnu -elem__t6vector1Zii -vector<int>::elem(int) -# ---format=gnu -__t6vector1Zdi -vector<double>::vector(int) -# ---format=gnu -__t6vector1Zii -vector<int>::vector(int) -# ---format=gnu -_\$_t6vector1Zdi -vector<double>::~vector(int) -# ---format=gnu -_\$_t6vector1Zii -vector<int>::~vector(int) -# ---format=gnu -__nw__t2T11ZcUi -T1<char>::operator new(unsigned int) -# ---format=gnu -__nw__t2T11Z1tUi -T1<t>::operator new(unsigned int) -# ---format=gnu -__dl__t2T11ZcPv -T1<char>::operator delete(void *) -# ---format=gnu -__dl__t2T11Z1tPv -T1<t>::operator delete(void *) -# ---format=gnu -__t2T11Zci -T1<char>::T1(int) -# ---format=gnu -__t2T11Zc -T1<char>::T1(void) -# ---format=gnu -__t2T11Z1ti -T1<t>::T1(int) -# ---format=gnu -__t2T11Z1t -T1<t>::T1(void) -# ---format=gnu -__Q2t4List1Z10VHDLEntity3Pix -List<VHDLEntity>::Pix::Pix(void) -# ---format=gnu -__Q2t4List1Z10VHDLEntity3PixPQ2t4List1Z10VHDLEntity7element -List<VHDLEntity>::Pix::Pix(List<VHDLEntity>::element *) -# ---format=gnu -__Q2t4List1Z10VHDLEntity3PixRCQ2t4List1Z10VHDLEntity3Pix -List<VHDLEntity>::Pix::Pix(List<VHDLEntity>::Pix const &) -# ---format=gnu -__Q2t4List1Z10VHDLEntity7elementRC10VHDLEntityPT0 -List<VHDLEntity>::element::element(VHDLEntity const &, List<VHDLEntity>::element *) -# ---format=gnu -__Q2t4List1Z10VHDLEntity7elementRCQ2t4List1Z10VHDLEntity7element -List<VHDLEntity>::element::element(List<VHDLEntity>::element const &) -# ---format=gnu -__cl__C11VHDLLibraryGt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity -VHDLLibrary::operator()(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >) const -# ---format=gnu -__cl__Ct4List1Z10VHDLEntityRCQ2t4List1Z10VHDLEntity3Pix -List<VHDLEntity>::operator()(List<VHDLEntity>::Pix const &) const -# ---format=gnu -__ne__FPvRCQ2t4List1Z10VHDLEntity3Pix -operator!=(void *, List<VHDLEntity>::Pix const &) -# ---format=gnu -__ne__FPvRCt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity -operator!=(void *, PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > const &) -# ---format=gnu -__t4List1Z10VHDLEntityRCt4List1Z10VHDLEntity -List<VHDLEntity>::List(List<VHDLEntity> const &) -# ---format=gnu -__t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity -PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(void) -# ---format=gnu -__t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntityP14VHDLLibraryRepGQ2t4List1Z10VHDLEntity3Pix -PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(VHDLLibraryRep *, List<VHDLEntity>::Pix) -# ---format=gnu -__t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntityRCt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity -PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > const &) -# ---format=gnu -nextE__C11VHDLLibraryRt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity -VHDLLibrary::nextE(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > &) const -# ---format=gnu -next__Ct4List1Z10VHDLEntityRQ2t4List1Z10VHDLEntity3Pix -List<VHDLEntity>::next(List<VHDLEntity>::Pix &) const -# ---format=gnu -_GLOBAL_\$D\$set -global destructors keyed to set -# ---format=gnu -_GLOBAL_\$I\$set -global constructors keyed to set -# ---format=gnu -__as__t5ListS1ZUiRCt5ListS1ZUi -ListS<unsigned int>::operator=(ListS<unsigned int> const &) -# ---format=gnu -__cl__Ct5ListS1ZUiRCQ2t5ListS1ZUi3Vix -ListS<unsigned int>::operator()(ListS<unsigned int>::Vix const &) const -# ---format=gnu -__cl__Ct5SetLS1ZUiRCQ2t5SetLS1ZUi3Vix -SetLS<unsigned int>::operator()(SetLS<unsigned int>::Vix const &) const -# ---format=gnu -__t10ListS_link1ZUiRCUiPT0 -ListS_link<unsigned int>::ListS_link(unsigned int const &, ListS_link<unsigned int> *) -# ---format=gnu -__t10ListS_link1ZUiRCt10ListS_link1ZUi -ListS_link<unsigned int>::ListS_link(ListS_link<unsigned int> const &) -# ---format=gnu -__t5ListS1ZUiRCt5ListS1ZUi -ListS<unsigned int>::ListS(ListS<unsigned int> const &) -# ---format=gnu -next__Ct5ListS1ZUiRQ2t5ListS1ZUi3Vix -ListS<unsigned int>::next(ListS<unsigned int>::Vix &) const -# ---format=gnu -__ne__FPvRCQ2t5SetLS1ZUi3Vix -operator!=(void *, SetLS<unsigned int>::Vix const &) -# ---format=gnu -__t8ListElem1Z5LabelRt4List1Z5Label -ListElem<Label>::ListElem(List<Label> &) -# ---format=gnu -__t8BDDHookV1ZPcRCPc -BDDHookV<char *>::BDDHookV(char *const &) -# ---format=gnu -_vt\$t8BDDHookV1ZPc -BDDHookV<char *> virtual table -# ---format=gnu -__ne__FPvRCQ211BDDFunction4VixB -operator!=(void *, BDDFunction::VixB const &) -# ---format=gnu -__eq__FPvRCQ211BDDFunction4VixB -operator==(void *, BDDFunction::VixB const &) -# ---format=gnu -relativeId__CQ36T_phi210T_preserve8FPC_nextRCQ26T_phi210T_preserveRC10Parameters -T_phi2::T_preserve::FPC_next::relativeId(T_phi2::T_preserve const &, Parameters const &) const -# ---format=lucid -WS__FR7istream -WS(istream &) -# ---format=lucid -__aa__3fooFR3foo -foo::operator&&(foo &) -# ---format=lucid -__aad__3fooFR3foo -foo::operator&=(foo &) -# ---format=lucid -__ad__3fooFR3foo -foo::operator&(foo &) -# ---format=lucid -__adv__3fooFR3foo -foo::operator/=(foo &) -# ---format=lucid -__adv__7complexF7complex -complex::operator/=(complex) -# ---format=lucid -__aer__3fooFR3foo -foo::operator^=(foo &) -# ---format=lucid -__als__3fooFR3foo -foo::operator<<=(foo &) -# ---format=lucid -__amd__3fooFR3foo -foo::operator%=(foo &) -# ---format=lucid -__ami__3fooFR3foo -foo::operator-=(foo &) -# ---format=lucid -__amu__3fooFR3foo -foo::operator*=(foo &) -# ---format=lucid -__amu__7complexF7complex -complex::operator*=(complex) -# ---format=lucid -__aor__3fooFR3foo -foo::operator|=(foo &) -# ---format=lucid -__apl__3fooFR3foo -foo::operator+=(foo &) -# ---format=lucid -__ars__3fooFR3foo -foo::operator>>=(foo &) -# ---format=lucid -__as__18istream_withassignFP9streambuf -istream_withassign::operator=(streambuf *) -# ---format=lucid -__as__18istream_withassignFR7istream -istream_withassign::operator=(istream &) -# ---format=lucid -__as__3fooFR3foo -foo::operator=(foo &) -# ---format=lucid -__as__3iosFR3ios -ios::operator=(ios &) -# ---format=lucid -__cl__3fooFR3foo -foo::operator()(foo &) -# ---format=lucid -__cm__3fooFR3foo -foo::operator, (foo &) -# ---format=lucid -__co__3fooFv -foo::operator~(void) -# ---format=lucid -__ct__10istrstreamFPc -istrstream::istrstream(char *) -# ---format=lucid -__ct__10istrstreamFPci -istrstream::istrstream(char *, int) -# ---format=lucid -__ct__10ostrstreamFPciT2 -ostrstream::ostrstream(char *, int, int) -# ---format=lucid -__ct__10ostrstreamFv -ostrstream::ostrstream(void) -# ---format=lucid -__ct__10smanip_intFPFR3iosi_R3iosi -smanip_int::smanip_int(ios &(*)(ios &, int), int) -# ---format=lucid -__ct__11fstreambaseFi -fstreambase::fstreambase(int) -# ---format=lucid -__ct__11fstreambaseFiPcT1 -fstreambase::fstreambase(int, char *, int) -# ---format=lucid -__ct__11fstreambaseFv -fstreambase::fstreambase(void) -# ---format=lucid -__ct__11smanip_longFPFR3iosl_R3iosl -smanip_long::smanip_long(ios &(*)(ios &, long), long) -# ---format=lucid -__ct__11stdiostreamFP4FILE -stdiostream::stdiostream(FILE *) -# ---format=lucid -__ct__12strstreambufFPFl_PvPFPv_v -strstreambuf::strstreambuf(void *(*)(long), void (*)(void *)) -# ---format=lucid -__ct__12strstreambufFPUciT1 -strstreambuf::strstreambuf(unsigned char *, int, unsigned char *) -# ---format=lucid -__ct__12strstreambufFPciT1 -strstreambuf::strstreambuf(char *, int, char *) -# ---format=lucid -__ct__12strstreambufFi -strstreambuf::strstreambuf(int) -# ---format=lucid -__ct__12strstreambufFv -strstreambuf::strstreambuf(void) -# ---format=lucid -__ct__13strstreambaseFPciT1 -strstreambase::strstreambase(char *, int, char *) -# ---format=lucid -__ct__3fooFR3foo -foo::foo(foo &) -# ---format=lucid -__ct__3fooFi -foo::foo(int) -# ---format=lucid -__ct__3fooFiN31 -foo::foo(int, int, int, int) -# ---format=lucid -__ct__3fooFiR3fooT1T2T1T2 -foo::foo(int, foo &, int, foo &, int, foo &) -# ---format=lucid -__ct__3iosFP9streambuf -ios::ios(streambuf *) -# ---format=lucid -__ct__7filebufFiPcT1 -filebuf::filebuf(int, char *, int) -# ---format=lucid -__ct__7fstreamFiPcT1 -fstream::fstream(int, char *, int) -# ---format=lucid -__ct__7istreamFP9streambuf -istream::istream(streambuf *) -# ---format=lucid -__ct__7istreamFP9streambufiP7ostream -istream::istream(streambuf *, int, ostream *) -# ---format=lucid -__ct__7istreamFiPcT1 -istream::istream(int, char *, int) -# ---format=lucid -__ct__7istreamFiT1P7ostream -istream::istream(int, int, ostream *) -# ---format=lucid -__ct__7ostreamFP9streambuf -ostream::ostream(streambuf *) -# ---format=lucid -__ct__7ostreamFiPc -ostream::ostream(int, char *) -# ---format=lucid -__ct__8ifstreamFiPcT1 -ifstream::ifstream(int, char *, int) -# ---format=lucid -__ct__Q23foo3barFv -foo::bar::bar(void) -# ---format=lucid -__ct__Q33foo3bar4bellFv -foo::bar::bell::bell(void) -# ---format=lucid -__dl__3fooSFPv -foo::operator delete(void *) static -# ---format=lucid -__dl__FPv -operator delete(void *) -# ---format=lucid -__dt__10istrstreamFv -istrstream::~istrstream(void) -# ---format=lucid -__dt__Q23foo3barFv -foo::bar::~bar(void) -# ---format=lucid -__dt__Q33foo3bar4bellFv -foo::bar::bell::~bell(void) -# ---format=lucid -__dv__3fooFR3foo -foo::operator/(foo &) -# ---format=lucid -__dv__F7complexT1 -operator/(complex, complex) -# ---format=lucid -__eq__3fooFR3foo -foo::operator==(foo &) -# ---format=lucid -__er__3fooFR3foo -foo::operator^(foo &) -# ---format=lucid -__ge__3fooFR3foo -foo::operator>=(foo &) -# ---format=lucid -__gt__3fooFR3foo -foo::operator>(foo &) -# ---format=lucid -__le__3fooFR3foo -foo::operator<=(foo &) -# ---format=lucid -__ls__3fooFR3foo -foo::operator<<(foo &) -# ---format=lucid -__ls__7ostreamFP9streambuf -ostream::operator<<(streambuf *) -# ---format=lucid -__ls__7ostreamFPFR3ios_R3ios -ostream::operator<<(ios &(*)(ios &)) -# ---format=lucid -__ls__7ostreamFPv -ostream::operator<<(void *) -# ---format=lucid -__ls__7ostreamFUi -ostream::operator<<(unsigned int) -# ---format=lucid -__ls__7ostreamFUl -ostream::operator<<(unsigned long) -# ---format=lucid -__ls__7ostreamFd -ostream::operator<<(double) -# ---format=lucid -__ls__7ostreamFf -ostream::operator<<(float) -# ---format=lucid -__ls__7ostreamFi -ostream::operator<<(int) -# ---format=lucid -__ls__7ostreamFl -ostream::operator<<(long) -# ---format=lucid -__ls__FR7ostream7complex -operator<<(ostream &, complex) -# ---format=lucid -__lt__3fooFR3foo -foo::operator<(foo &) -# ---format=lucid -__md__3fooFR3foo -foo::operator%(foo &) -# ---format=lucid -__mi__3fooFR3foo -foo::operator-(foo &) -# ---format=lucid -__ml__3fooFR3foo -foo::operator*(foo &) -# ---format=lucid -__ml__F7complexT1 -operator*(complex, complex) -# ---format=lucid -__mm__3fooFi -foo::operator--(int) -# ---format=lucid -__ne__3fooFR3foo -foo::operator!=(foo &) -# ---format=lucid -__nt__3fooFv -foo::operator!(void) -# ---format=lucid -__nw__3fooSFi -foo::operator new(int) static -# ---format=lucid -__nw__FUi -operator new(unsigned int) -# ---format=lucid -__nw__FUiPv -operator new(unsigned int, void *) -# ---format=lucid -__oo__3fooFR3foo -foo::operator||(foo &) -# ---format=lucid -__opPc__3fooFv -foo::operator char *(void) -# ---format=lucid -__opi__3fooFv -foo::operator int(void) -# ---format=lucid -__or__3fooFR3foo -foo::operator|(foo &) -# ---format=lucid -__pl__3fooFR3foo -foo::operator+(foo &) -# ---format=lucid -__pp__3fooFi -foo::operator++(int) -# ---format=lucid -__pt__3fooFv -foo::operator->(void) -# ---format=lucid -__rm__3fooFR3foo -foo::operator->*(foo &) -# ---format=lucid -__rs__3fooFR3foo -foo::operator>>(foo &) -# ---format=lucid -__rs__7istreamFP9streambuf -istream::operator>>(streambuf *) -# ---format=lucid -__rs__7istreamFPFR3ios_R3ios -istream::operator>>(ios &(*)(ios &)) -# ---format=lucid -__rs__7istreamFPFR7istream_R7istream -istream::operator>>(istream &(*)(istream &)) -# ---format=lucid -__rs__7istreamFPUc -istream::operator>>(unsigned char *) -# ---format=lucid -__rs__7istreamFPc -istream::operator>>(char *) -# ---format=lucid -__rs__7istreamFRUi -istream::operator>>(unsigned int &) -# ---format=lucid -__rs__7istreamFRUl -istream::operator>>(unsigned long &) -# ---format=lucid -__rs__7istreamFRUs -istream::operator>>(unsigned short &) -# ---format=lucid -__rs__7istreamFRd -istream::operator>>(double &) -# ---format=lucid -__rs__7istreamFRf -istream::operator>>(float &) -# ---format=lucid -__rs__7istreamFRi -istream::operator>>(int &) -# ---format=lucid -__rs__7istreamFRl -istream::operator>>(long &) -# ---format=lucid -__rs__7istreamFRs -istream::operator>>(short &) -# ---format=lucid -__rs__FR7istreamR7complex -operator>>(istream &, complex &) -# ---format=lucid -__vtbl__10istrstream -istrstream virtual table -# ---format=lucid -__vtbl__17ostream__iostream__19iostream_withassign -iostream_withassign::ostream__iostream virtual table -# ---format=lucid -__vtbl__3ios -ios virtual table -# ---format=lucid -__vtbl__3ios__13strstreambase -strstreambase::ios virtual table -# ---format=lucid -abs__F7complex -abs(complex) -# ---format=lucid -allocate__9streambufFv -streambuf::allocate(void) -# ---format=lucid -attach__11fstreambaseFi -fstreambase::attach(int) -# ---format=lucid -bitalloc__3iosSFv -ios::bitalloc(void) static -# ---format=lucid -chr__FiT1 -chr(int, int) -# ---format=lucid -complex_error__FR11c_exception -complex_error(c_exception &) -# ---format=lucid -complexfunc2__FPFPc_i -complexfunc2(int (*)(char *)) -# ---format=lucid -complexfunc3__FPFPFPl_s_i -complexfunc3(int (*)(short (*)(long *))) -# ---format=lucid -complexfunc4__FPFPFPc_s_i -complexfunc4(int (*)(short (*)(char *))) -# ---format=lucid -complexfunc5__FPFPc_PFl_i -complexfunc5(int (*(*)(char *))(long)) -# ---format=lucid -complexfunc6__FPFPi_PFl_i -complexfunc6(int (*(*)(int *))(long)) -# ---format=lucid -complexfunc7__FPFPFPc_i_PFl_i -complexfunc7(int (*(*)(int (*)(char *)))(long)) -# ---format=lucid -complicated_put__7ostreamFc -ostream::complicated_put(char) -# ---format=lucid -conv10__FlPc -conv10(long, char *) -# ---format=lucid -conv16__FUlPc -conv16(unsigned long, char *) -# ---format=lucid -dec__FR3ios -dec(ios &) -# ---format=lucid -dec__Fli -dec(long, int) -# ---format=lucid -dofield__FP7ostreamPciT2T3 -dofield(ostream *, char *, int, char *, int) -# ---format=lucid -flags__3iosFl -ios::flags(long) -# ---format=lucid -flags__3iosFv -ios::flags(void) -# ---format=lucid -foo__FiN31 -foo(int, int, int, int) -# ---format=lucid -foo__FiR3fooT1T2T1T2 -foo(int, foo &, int, foo &, int, foo &) -# ---format=lucid -foo___3barFl -bar::foo_(long) -# ---format=lucid -get__7istreamFPcic -istream::get(char *, int, char) -# ---format=lucid -get__7istreamFR9streambufc -istream::get(streambuf &, char) -# ---format=lucid -get_complicated__7istreamFRUc -istream::get_complicated(unsigned char &) -# ---format=lucid -get_complicated__7istreamFRc -istream::get_complicated(char &) -# ---format=lucid -getline__7istreamFPUcic -istream::getline(unsigned char *, int, char) -# ---format=lucid -getline__7istreamFPcic -istream::getline(char *, int, char) -# ---format=lucid -ignore__7istreamFiT1 -istream::ignore(int, int) -# ---format=lucid -init__12strstreambufFPciT1 -strstreambuf::init(char *, int, char *) -# ---format=lucid -init__3iosFP9streambuf -ios::init(streambuf *) -# ---format=lucid -initcount__13Iostream_init -Iostream_init::initcount -# ---format=lucid -ipfx__7istreamFi -istream::ipfx(int) -# ---format=lucid -ls_complicated__7ostreamFUc -ostream::ls_complicated(unsigned char) -# ---format=lucid -ls_complicated__7ostreamFc -ostream::ls_complicated(char) -# ---format=lucid -overload1arg__FSc -overload1arg(signed char) -# ---format=lucid -overload1arg__FUc -overload1arg(unsigned char) -# ---format=lucid -overload1arg__FUi -overload1arg(unsigned int) -# ---format=lucid -overload1arg__FUl -overload1arg(unsigned long) -# ---format=lucid -overload1arg__FUs -overload1arg(unsigned short) -# ---format=lucid -overload1arg__Fc -overload1arg(char) -# ---format=lucid -overload1arg__Fd -overload1arg(double) -# ---format=lucid -overload1arg__Ff -overload1arg(float) -# ---format=lucid -overload1arg__Fi -overload1arg(int) -# ---format=lucid -overload1arg__Fl -overload1arg(long) -# ---format=lucid -overload1arg__Fs -overload1arg(short) -# ---format=lucid -overload1arg__Fv -overload1arg(void) -# ---format=lucid -overloadargs__FiN21 -overloadargs(int, int, int) -# ---format=lucid -overloadargs__FiN31 -overloadargs(int, int, int, int) -# ---format=lucid -overloadargs__FiN41 -overloadargs(int, int, int, int, int) -# ---format=lucid -overloadargs__FiN51 -overloadargs(int, int, int, int, int, int) -# ---format=lucid -overloadargs__FiN61 -overloadargs(int, int, int, int, int, int, int) -# ---format=lucid -overloadargs__FiN71 -overloadargs(int, int, int, int, int, int, int, int) -# ---format=lucid -overloadargs__FiN81 -overloadargs(int, int, int, int, int, int, int, int, int) -# ---format=lucid -overloadargs__FiN91 -overloadargs(int, int, int, int, int, int, int, int, int, int) -# ---format=lucid -overloadargs__FiN91N11 -overloadargs(int, int, int, int, int, int, int, int, int, int, int) -# ---format=lucid -overloadargs__FiT1 -overloadargs(int, int) -# ---format=lucid -polar__FdT1 -polar(double, double) -# ---format=lucid -pow__F7complexT1 -pow(complex, complex) -# ---format=lucid -pow__F7complexd -pow(complex, double) -# ---format=lucid -pow__F7complexi -pow(complex, int) -# ---format=lucid -pow__Fd7complex -pow(double, complex) -# ---format=lucid -pstart__FPciT2 -pstart(char *, int, int) -# ---format=lucid -put__7ostreamFc -ostream::put(char) -# ---format=lucid -read__7istreamFPci -istream::read(char *, int) -# ---format=lucid -resetiosflags__FR3iosl -resetiosflags(ios &, long) -# ---format=lucid -restore_errno__FRi -restore_errno(int &) -# ---format=lucid -rs_complicated__7istreamFRUc -istream::rs_complicated(unsigned char &) -# ---format=lucid -rs_complicated__7istreamFRc -istream::rs_complicated(char &) -# ---format=lucid -seekg__7istreamFl8seek_dir -istream::seekg(long, seek_dir) -# ---format=lucid -seekoff__12strstreambufFl8seek_diri -strstreambuf::seekoff(long, seek_dir, int) -# ---format=lucid -seekoff__9streambufFlQ2_3ios12ios_seek_diri -streambuf::seekoff(long, ios::ios_seek_dir, int) -# ---format=lucid -seekpos__9streambufFli -streambuf::seekpos(long, int) -# ---format=lucid -set_new_handler__FPFv_v -set_new_handler(void (*)(void)) -# ---format=lucid -setb__9streambufFPcT1i -streambuf::setb(char *, char *, int) -# ---format=lucid -setb__FR3iosi -setb(ios &, int) -# ---format=lucid -setbuf__11fstreambaseFPci -fstreambase::setbuf(char *, int) -# ---format=lucid -setbuf__9streambufFPUci -streambuf::setbuf(unsigned char *, int) -# ---format=lucid -setbuf__9streambufFPciT2 -streambuf::setbuf(char *, int, int) -# ---format=lucid -setf__3iosFlT1 -ios::setf(long, long) -# ---format=lucid -setfill__FR3iosi -setfill(ios &, int) -# ---format=lucid -setg__9streambufFPcN21 -streambuf::setg(char *, char *, char *) -# ---format=lucid -setp__9streambufFPcT1 -streambuf::setp(char *, char *) -# ---format=lucid -tie__3iosFP7ostream -ios::tie(ostream *) -# ---format=lucid -uconv10__FUlPc -uconv10(unsigned long, char *) -# ---format=lucid -xget__7istreamFPc -istream::xget(char *) -# ---format=lucid -xsgetn__9streambufFPci -streambuf::xsgetn(char *, int) -# ---format=arm -__dt__21T5__pt__11_PFiPPdPv_iFv -T5<int (*)(int, double **, void *)>::~T5(void) -# ---format=arm -__ct__1cFi -c::c(int) -# ---format=arm -__dt__11T5__pt__2_iFv -T5<int>::~T5(void) -# ---format=arm -__dt__11T5__pt__2_cFv -T5<char>::~T5(void) -# ---format=arm -__ct__2T2Fi -T2::T2(int) -# ---format=arm -__dt__2T1Fv -T1::~T1(void) -# ---format=arm -__dt__12T5__pt__3_1xFv -T5<x>::~T5(void) -# ---format=arm -__dt__17T5__pt__8_PFcPv_iFv -T5<int (*)(char, void *)>::~T5(void) -# ---format=arm -__ct__21T5__pt__11_PFiPPdPv_iFi -T5<int (*)(int, double **, void *)>::T5(int) -# ---format=arm -__amd__FR2T2i -operator%=(T2 &, int) -# ---format=arm -__adv__FR2T2i -operator/=(T2 &, int) -# ---format=arm -__amu__FR2T2i -operator*=(T2 &, int) -# ---format=arm -__ami__FR2T2i -operator-=(T2 &, int) -# ---format=arm -__apl__FR2T2i -operator+=(T2 &, int) -# ---format=arm -__nw__2T1SFUi -T1::operator new(unsigned int) static -# ---format=arm -__dl__2T1SFPv -T1::operator delete(void *) static -# ---format=arm -put__2T7SFi -T7::put(int) static -# ---format=arm -__dl__12T5__pt__3_1xSFPv -T5<x>::operator delete(void *) static -# ---format=arm -h__FUc -h(unsigned char) -# ---format=arm -f__Fic -f(int, char) -# ---format=arm -h__FUi -h(unsigned int) -# ---format=arm -h__Fci -h(char, int) -# ---format=arm -h__FUl -h(unsigned long) -# ---format=arm -h__Fcl -h(char, long) -# ---format=arm -h__FUs -h(unsigned short) -# ---format=arm -h__Fcs -h(char, short) -# ---format=arm -X__12T5__pt__3_1x -T5<x>::X -# ---format=arm -__ct__11T5__pt__2_iFi -T5<int>::T5(int) -# ---format=arm -__ct__11T5__pt__2_cFi -T5<char>::T5(int) -# ---format=arm -h__FcT1 -h(char, char) -# ---format=arm -f__Ficd -f(int, char, double) -# ---format=arm -__dl__17T5__pt__8_PFcPv_iSFPv -T5<int (*)(char, void *)>::operator delete(void *) static -# ---format=arm -X__17T5__pt__8_PFcPv_i -T5<int (*)(char, void *)>::X -# ---format=arm -__ct__12T5__pt__3_1xFi -T5<x>::T5(int) -# ---format=arm -__dl__21T5__pt__11_PFiPPdPv_iSFPv -T5<int (*)(int, double **, void *)>::operator delete(void *) static -# ---format=arm -__std__foo -global destructors keyed to foo -# ---format=arm -__sti__bar -global constructors keyed to bar -# ---format=arm -f__FicdPcPFci_v -f(int, char, double, char *, void (*)(char, int)) -# ---format=arm -f__FicdPcPFic_v -f(int, char, double, char *, void (*)(int, char)) -# ---format=arm -get__2T7SFv -T7::get(void) static -# ---format=arm -X__21T5__pt__11_PFiPPdPv_i -T5<int (*)(int, double **, void *)>::X -# ---format=arm -__dl__11T5__pt__2_iSFPv -T5<int>::operator delete(void *) static -# ---format=arm -__dl__11T5__pt__2_cSFPv -T5<char>::operator delete(void *) static -# ---format=arm -h__Fc -h(char) -# ---format=arm -h__Fd -h(double) -# ---format=arm -h__Ff -h(float) -# ---format=arm -h__Fi -h(int) -# ---format=arm -f__Fi -f(int) -# ---format=arm -h__Fl -h(long) -# ---format=arm -h__Fs -h(short) -# ---format=arm -X__11T5__pt__2_c -T5<char>::X -# ---format=arm -X__11T5__pt__2_i -T5<int>::X -# ---format=arm -__ct__17T5__pt__8_PFcPv_iFi -T5<int (*)(char, void *)>::T5(int) -# ---format=arm -f__FicdPc -f(int, char, double, char *) -# ---format=arm -__nw__FUi -operator new(unsigned int) -# ---format=arm -__ct__Q3_2T11a1bSFi -T1::a::b::b(int) static -# ---format=arm -__dt__Q3_2T11a1bSFi -T1::a::b::~b(int) static -# ---format=arm -put__Q3_2T11a1bSFi -T1::a::b::put(int) static -# ---format=arm -get__Q2_2T11aSFv -T1::a::get(void) static -# ---format=arm -put__2T1SFi -T1::put(int) static -# ---format=arm -put__Q5_2T11a1b1c1dSFi -T1::a::b::c::d::put(int) static -# ---format=arm -get__Q4_2T11a1b1cSFv -T1::a::b::c::get(void) static -# ---format=arm -put__Q2_2T11aSFi -T1::a::put(int) static -# ---format=arm -put__Q4_2T11a1b1cSFi -T1::a::b::c::put(int) static -# ---format=arm -get__Q3_2T11a1bSFv -T1::a::b::get(void) static -# ---format=arm -get__2T1SFv -T1::get(void) static -# ---format=arm -get__Q5_2T11a1b1c1dSFv -T1::a::b::c::d::get(void) static -# ---format=arm -__dt__11T1__pt__2_cFv -T1<char>::~T1(void) -# ---format=arm -__dt__12T1__pt__3_1tFv -T1<t>::~T1(void) -# ---format=arm -__dl__12T1__pt__3_1tSFPv -T1<t>::operator delete(void *) static -# ---format=arm -__ct__11T1__pt__2_cFi -T1<char>::T1(int) -# ---format=arm -__ct__11T1__pt__2_cFv -T1<char>::T1(void) -# ---format=arm -__ct__12T1__pt__3_1tFi -T1<t>::T1(int) -# ---format=arm -__ct__12T1__pt__3_1tFv -T1<t>::T1(void) -# ---format=arm -__dl__11T1__pt__2_cSFPv -T1<char>::operator delete(void *) static -# ---format=arm -bar__3fooFPv -foo::bar(void *) -# ---format=arm -bar__3fooCFPv -foo::bar(void *) const -# ---format=arm -__eq__3fooFR3foo -foo::operator==(foo &) -# ---format=arm -__eq__3fooCFR3foo -foo::operator==(foo &) const -# ---format=arm -elem__15vector__pt__2_dFi -vector<double>::elem(int) -# ---format=arm -elem__15vector__pt__2_iFi -vector<int>::elem(int) -# ---format=arm -__ct__15vector__pt__2_dFi -vector<double>::vector(int) -# ---format=arm -__ct__15vector__pt__2_iFi -vector<int>::vector(int) -# ---format=arm -__ct__25DListNode__pt__9_R6RLabelFR6RLabelP25DListNode__pt__9_R6RLabelT2 -DListNode<RLabel &>::DListNode(RLabel &, DListNode<RLabel &> *, DListNode<RLabel &> *) -# ---format=arm -bar__3fooFiT16FooBar -foo::bar(int, int, FooBar) -# ---format=arm -bar__3fooFPiN51PdN37PcN211T1iN215 -foo::bar(int *, int *, int *, int *, int *, int *, double *, double *, double *, double *, char *, char *, char *, int *, int, int, int) -# ---format=hp -__amd__FR2T2i -operator%=(T2 &, int) -# ---format=hp -__adv__FR2T2i -operator/=(T2 &, int) -# ---format=hp -__amu__FR2T2i -operator*=(T2 &, int) -# ---format=hp -__ami__FR2T2i -operator-=(T2 &, int) -# ---format=hp -__apl__FR2T2i -operator+=(T2 &, int) -# ---format=hp -__nw__2T1SFUi -T1::operator new(unsigned int) static -# ---format=hp -__dl__2T1SFPv -T1::operator delete(void *) static -# ---format=hp -put__2T7SFi -T7::put(int) static -# ---format=hp -h__FUc -h(unsigned char) -# ---format=hp -f__Fic -f(int, char) -# ---format=hp -h__FUi -h(unsigned int) -# ---format=hp -h__Fci -h(char, int) -# ---format=hp -h__FUl -h(unsigned long) -# ---format=hp -h__Fcl -h(char, long) -# ---format=hp -h__FUs -h(unsigned short) -# ---format=hp -h__Fcs -h(char, short) -# ---format=hp -h__FcT1 -h(char, char) -# ---format=hp -f__Ficd -f(int, char, double) -# ---format=hp -f__FicdPcPFci_v -f(int, char, double, char *, void (*)(char, int)) -# ---format=hp -f__FicdPcPFic_v -f(int, char, double, char *, void (*)(int, char)) -# ---format=hp -get__2T7SFv -T7::get(void) static -# ---format=hp -h__Fc -h(char) -# ---format=hp -h__Fd -h(double) -# ---format=hp -h__Ff -h(float) -# ---format=hp -h__Fi -h(int) -# ---format=hp -f__Fi -f(int) -# ---format=hp -h__Fl -h(long) -# ---format=hp -h__Fs -h(short) -# ---format=hp -f__FicdPc -f(int, char, double, char *) -# ---format=hp -__nw__FUi -operator new(unsigned int) -# ---format=hp -__ct__Q3_2T11a1bSFi -T1::a::b::b(int) static -# ---format=hp -__dt__Q3_2T11a1bSFi -T1::a::b::~b(int) static -# ---format=hp -put__Q3_2T11a1bSFi -T1::a::b::put(int) static -# ---format=hp -get__Q2_2T11aSFv -T1::a::get(void) static -# ---format=hp -put__2T1SFi -T1::put(int) static -# ---format=hp -put__Q5_2T11a1b1c1dSFi -T1::a::b::c::d::put(int) static -# ---format=hp -get__Q4_2T11a1b1cSFv -T1::a::b::c::get(void) static -# ---format=hp -put__Q2_2T11aSFi -T1::a::put(int) static -# ---format=hp -put__Q4_2T11a1b1cSFi -T1::a::b::c::put(int) static -# ---format=hp -get__Q3_2T11a1bSFv -T1::a::b::get(void) static -# ---format=hp -get__2T1SFv -T1::get(void) static -# ---format=hp -get__Q5_2T11a1b1c1dSFv -T1::a::b::c::d::get(void) static -# ---format=hp -bar__3fooFPv -foo::bar(void *) -# ---format=hp -bar__3fooCFPv -foo::bar(void *) const -# ---format=hp -__eq__3fooFR3foo -foo::operator==(foo &) -# ---format=hp -__eq__3fooCFR3foo -foo::operator==(foo &) const -# ---format=hp -bar__3fooFiT16FooBar -foo::bar(int, int, FooBar) -# ---format=hp -bar__3fooFPiN51PdN37PcN211T1iN215 -foo::bar(int *, int *, int *, int *, int *, int *, double *, double *, double *, double *, char *, char *, char *, int *, int, int, int) -# ---format=hp -__dt__2T5XTPFiPPdPv_i__Fv -T5<int (*)(int, double **, void *)>::~T5(void) -# ---format=hp -__ct__1cFi -c::c(int) -# ---format=hp -__dt__2T5XTi__Fv -T5<int>::~T5(void) -# ---format=hp -__dt__2T5XTc__Fv -T5<char>::~T5(void) -# ---format=hp -__ct__2T2Fi -T2::T2(int) -# ---format=hp -__dt__2T1Fv -T1::~T1(void) -# ---format=hp -__dt__2T5XT1x__Fv -T5<x>::~T5(void) -# ---format=hp -__dt__2T5XTPFcPv_i__Fv -T5<int (*)(char, void *)>::~T5(void) -# ---format=hp -__ct__2T5XTPFiPPdPv_i__Fi -T5<int (*)(int, double **, void *)>::T5(int) -# ---format=hp -__dl__2T5XT1x__SFPv -T5<x>::operator delete(void *) static -# ---format=hp -X__2T5XT1x -T5<x>::X -# ---format=hp -__ct__2T5XTi__Fi -T5<int>::T5(int) -# ---format=hp -__ct__2T5XTc__Fi -T5<char>::T5(int) -# ---format=hp -__dl__2T5XTPFcPv_i__SFPv -T5<int (*)(char, void *)>::operator delete(void *) static -# ---format=hp -X__2T5XTPFcPv_i -T5<int (*)(char, void *)>::X -# ---format=hp -__ct__2T5XT1x__Fi -T5<x>::T5(int) -# ---format=hp -__dl__2T5XTPFiPPdPv_i__SFPv -T5<int (*)(int, double **, void *)>::operator delete(void *) static -# ---format=hp -X__2T5XTPFiPPdPv_i -T5<int (*)(int, double **, void *)>::X -# ---format=hp -__dl__2T5XTi__SFPv -T5<int>::operator delete(void *) static -# ---format=hp -__dl__2T5XTc__SFPv -T5<char>::operator delete(void *) static -# ---format=hp -X__2T5XTc -T5<char>::X -# ---format=hp -X__2T5XTi -T5<int>::X -# ---format=hp -__ct__2T5XTPFcPv_i__Fi -T5<int (*)(char, void *)>::T5(int) -# ---format=hp -__dt__2T1XTc__Fv -T1<char>::~T1(void) -# ---format=hp -__dt__2T1XT1t__Fv -T1<t>::~T1(void) -# ---format=hp -__dl__2T1XT1t__SFPv -T1<t>::operator delete(void *) static -# ---format=hp -__ct__2T1XTc__Fi -T1<char>::T1(int) -# ---format=hp -__ct__2T1XTc__Fv -T1<char>::T1(void) -# ---format=hp -__ct__2T1XT1t__Fi -T1<t>::T1(int) -# ---format=hp -__ct__2T1XT1t__Fv -T1<t>::T1(void) -# ---format=hp -__dl__2T1XTc__SFPv -T1<char>::operator delete(void *) static -# ---format=hp -elem__6vectorXTd__Fi -vector<double>::elem(int) -# ---format=hp -elem__6vectorXTi__Fi -vector<int>::elem(int) -# ---format=hp -__ct__6vectorXTd__Fi -vector<double>::vector(int) -# ---format=hp -__ct__6vectorXTi__Fi -vector<int>::vector(int) -# ---format=hp -__ct__9DListNodeXTR6RLabel__FR6RLabelP9DListNodeXTR6RLabel_T2 -DListNode<RLabel &>::DListNode(RLabel &, DListNode<RLabel &> *, DListNode<RLabel &> *) -# ---format=hp -elem__6vectorXTiUP34__Fi -vector<int,34U>::elem(int) -# ---format=hp -elem__6vectorXUP2701Td__Fi -vector<2701U,double>::elem(int) -# ---format=hp -elem__6vectorXTiSP334__Fi -vector<int,334>::elem(int) -# ---format=hp -elem__6vectorXTiSN67__Fi -vector<int,-67>::elem(int) -# ---format=hp -elem__6vectorXTiSM__SCFPPd -vector<int,-2147483648>::elem(double **) static const -# ---format=hp -elem__6vectorXTiSN67UP4000TRs__Fi -vector<int,-67,4000U,short &>::elem(int) -# ---format=hp -elem__6vectorXTiSN67TRdTFPv_i__Fi -vector<int,-67,double &,int (void *)>::elem(int) -# ---format=hp -X__6vectorXTiSN67TdTPvUP5TRs -vector<int,-67,double,void *,5U,short &>::X -# ---format=hp -elem__6vectorXTiA3foo__Fi -vector<int,&foo>::elem(int) -# ---format=hp -elem__6vectorXTiA3fooTPvA5Label__FiPPvT2 -vector<int,&foo,void *,&Label>::elem(int, void **, void **) -# ---format=hp -elem__6vectorXTiSN42A3foo__Fi -vector<int,-42,&foo>::elem(int) -# ---format=hp -__ct__2T5XTPFcPv_i__Fi_2 -T5<int (*)(char, void *)>::T5(int) -# ---format=hp -__ct__2T5XTPFcPv_i__Fi_19 -T5<int (*)(char, void *)>::T5(int) -# ---format=hp -f__FicdPcPFci_v_34 -f(int, char, double, char *, void (*)(char, int)) -# ---format=hp -spec__13Spec<#1,#1.*>XTiTPi_FPi -Spec<int,int *>::spec(int *) -# ---format=hp -spec__16Spec<#1,#1.&,#1>XTiTRiTi_FPi -Spec<int,int &,int>::spec(int *) -# ---format=hp -add__XTc_FcT1 -add<char>(char, char) -# ---format=hp -add__XTcSP9A5label_FcPPlT1 -add<char,9,&label>(char, long **, char) -# ---format=hp -add__XTPfTFPd_f_FcT1 -add<float *,float (double *)>(char, char) -# ---format=hp -unLink__12basic_stringXTcT18string_char_traitsXTc_T9allocator_Fv -basic_string<char,string_char_traits<char>,allocator>::unLink(void) -# -# A regression test with no args. This used to cause a segv. - -_Utf390_1__1_9223372036854775807__9223372036854775 -_Utf390_1__1_9223372036854775807__9223372036854775 -# ---format=gnu -call__H1Z4Test_RX01_t1C2ZX01PMX01FPX01i_vQ2X016output -C<Test, Test::output> call<Test>(Test &) -# ---format=gnu -fn__FPQ21n1cPMQ21n1cFPQ21n1c_i -fn(n::c *, int (n::c::*)(n::c *)) -# ---format=gnu -f__FGt3Bar1i21i -f(Bar<2>, i) -# ---format=gnu -f__FGt3Bar1i_21_i -f(Bar<21>, int) -# ---format=gnu -f__FGt3Bar1i24XY_t -f(Bar<2>, XY_t) diff --git a/gnu/egcs/libiberty/testsuite/regress-demangle b/gnu/egcs/libiberty/testsuite/regress-demangle deleted file mode 100644 index bd48ce9013e..00000000000 --- a/gnu/egcs/libiberty/testsuite/regress-demangle +++ /dev/null @@ -1,28 +0,0 @@ -#! /bin/sh - -# Run a regression test for the demangler. -# Usage: regress-demangle TEST-FILE - -failures=0 -count=0 -sed -e '/^#/ d' "$1" | ( - while read type; do - read mangled - read demangled - - x="`echo $mangled | ./test-filter $type`" - count=`expr $count + 1` - if test "x$x" != "x$demangled"; then - failures=`expr $failures + 1` - echo "FAIL: $type $mangled" - fi - done - - if test $failures -eq 0; then - echo "All $count tests passed" - else - echo "$failures of $count tests failed" - fi - - test $failures -eq 0 -) diff --git a/gnu/egcs/libiberty/tmpnam.c b/gnu/egcs/libiberty/tmpnam.c deleted file mode 100644 index 8eb77e28c0b..00000000000 --- a/gnu/egcs/libiberty/tmpnam.c +++ /dev/null @@ -1,39 +0,0 @@ -#include <stdio.h> - -#ifndef L_tmpnam -#define L_tmpnam 100 -#endif -#ifndef P_tmpdir -#define P_tmpdir "/usr/tmp" -#endif - -static char tmpnam_buffer[L_tmpnam]; -static int tmpnam_counter; - -extern int getpid (); - -char * -tmpnam (s) - char *s; -{ - int pid = getpid (); - - if (s == NULL) - s = tmpnam_buffer; - - /* Generate the filename and make sure that there isn't one called - it already. */ - - while (1) - { - FILE *f; - sprintf (s, "%s/%s%x.%x", P_tmpdir, "t", pid, tmpnam_counter); - f = fopen (s, "r"); - if (f == NULL) - break; - tmpnam_counter++; - fclose (f); - } - - return s; -} diff --git a/gnu/egcs/libiberty/vasprintf.c b/gnu/egcs/libiberty/vasprintf.c deleted file mode 100644 index b959f5f9ca5..00000000000 --- a/gnu/egcs/libiberty/vasprintf.c +++ /dev/null @@ -1,173 +0,0 @@ -/* Like vsprintf but provides a pointer to malloc'd storage, which must - be freed by the caller. - Copyright (C) 1994 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#ifdef __STDC__ -#include <stdarg.h> -#else -#include <varargs.h> -#endif -#include <stdio.h> -#include <string.h> -#include <ansidecl.h> - -#ifdef TEST -int global_total_width; -#endif - -unsigned long strtoul (); -char *malloc (); - -static int -int_vasprintf (result, format, args) - char **result; - const char *format; - va_list *args; -{ - const char *p = format; - /* Add one to make sure that it is never zero, which might cause malloc - to return NULL. */ - int total_width = strlen (format) + 1; - va_list ap; - - memcpy ((PTR) &ap, (PTR) args, sizeof (va_list)); - - while (*p != '\0') - { - if (*p++ == '%') - { - while (strchr ("-+ #0", *p)) - ++p; - if (*p == '*') - { - ++p; - total_width += abs (va_arg (ap, int)); - } - else - total_width += strtoul (p, &p, 10); - if (*p == '.') - { - ++p; - if (*p == '*') - { - ++p; - total_width += abs (va_arg (ap, int)); - } - else - total_width += strtoul (p, &p, 10); - } - while (strchr ("hlL", *p)) - ++p; - /* Should be big enough for any format specifier except %s and floats. */ - total_width += 30; - switch (*p) - { - case 'd': - case 'i': - case 'o': - case 'u': - case 'x': - case 'X': - case 'c': - (void) va_arg (ap, int); - break; - case 'f': - case 'e': - case 'E': - case 'g': - case 'G': - (void) va_arg (ap, double); - /* Since an ieee double can have an exponent of 307, we'll - make the buffer wide enough to cover the gross case. */ - total_width += 307; - break; - case 's': - total_width += strlen (va_arg (ap, char *)); - break; - case 'p': - case 'n': - (void) va_arg (ap, char *); - break; - } - p++; - } - } -#ifdef TEST - global_total_width = total_width; -#endif - *result = malloc (total_width); - if (*result != NULL) - return vsprintf (*result, format, *args); - else - return 0; -} - -int -vasprintf (result, format, args) - char **result; - const char *format; -#if defined (_BSD_VA_LIST_) && defined (__FreeBSD__) - _BSD_VA_LIST_ args; -#else - va_list args; -#endif -{ - return int_vasprintf (result, format, &args); -} - -#ifdef TEST -void -checkit -#ifdef __STDC__ - (const char* format, ...) -#else - (va_alist) - va_dcl -#endif -{ - va_list args; - char *result; - -#ifdef __STDC__ - va_start (args, format); -#else - char *format; - va_start (args); - format = va_arg (args, char *); -#endif - vasprintf (&result, format, args); - if (strlen (result) < global_total_width) - printf ("PASS: "); - else - printf ("FAIL: "); - printf ("%d %s\n", global_total_width, result); -} - -int -main () -{ - checkit ("%d", 0x12345678); - checkit ("%200d", 5); - checkit ("%.300d", 6); - checkit ("%100.150d", 7); - checkit ("%s", "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\ -777777777777777777333333333333366666666666622222222222777777777777733333"); - checkit ("%f%s%d%s", 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx"); -} -#endif /* TEST */ diff --git a/gnu/egcs/libiberty/vfork.c b/gnu/egcs/libiberty/vfork.c deleted file mode 100644 index 86c45919f66..00000000000 --- a/gnu/egcs/libiberty/vfork.c +++ /dev/null @@ -1,8 +0,0 @@ -/* Emulate vfork using just plain fork, for systems without a real vfork. - This function is in the public domain. */ - -int -vfork () -{ - return (fork ()); -} diff --git a/gnu/egcs/libiberty/vfprintf.c b/gnu/egcs/libiberty/vfprintf.c deleted file mode 100644 index db7b2ff4c19..00000000000 --- a/gnu/egcs/libiberty/vfprintf.c +++ /dev/null @@ -1,21 +0,0 @@ -/* Provide a version vfprintf in terms of _doprnt. - By Kaveh Ghazi (ghazi@caip.rutgers.edu) 3/29/98 - Copyright (C) 1998 Free Software Foundation, Inc. - */ - -#ifdef __STDC__ -#include <stdarg.h> -#else -#include <varargs.h> -#endif -#include <stdio.h> -#undef vfprintf - -int -vfprintf (stream, format, ap) - FILE * stream; - const char * format; - va_list ap; -{ - return _doprnt (format, ap, stream); -} diff --git a/gnu/egcs/libiberty/vmsbuild.com b/gnu/egcs/libiberty/vmsbuild.com deleted file mode 100644 index 4fede380bfd..00000000000 --- a/gnu/egcs/libiberty/vmsbuild.com +++ /dev/null @@ -1,165 +0,0 @@ -$! libiberty/vmsbuild.com -- build liberty.olb for VMS host, VMS target -$! -$ CC = "gcc /noVerbose/Debug/Incl=([],[-.include])" -$ LIBR = "library /Obj" -$ LINK = "link" -$ DELETE= "delete /noConfirm" -$ SEARCH= "search /Exact" -$ ECHO = "write sys$output" -$ ABORT = "exit %x002C" -$! -$ LIB_NAME = "liberty.olb" !this is what we're going to construct -$ WORK_LIB = "new-lib.olb" !used to guard against an incomplete build -$ -$! manually copied from Makefile.in -$ REQUIRED_OFILES = "argv.o basename.o choose-temp.o concat.o cplus-dem.o "- - + "fdmatch.o fnmatch.o getopt.o getopt1.o getruntime.o hex.o "- - + "floatformat.o objalloc.o obstack.o spaces.o strerror.o strsignal.o "- - + "xatexit.o xexit.o xmalloc.o xstrdup.o xstrerror.o" -$! anything not caught by link+search of dummy.* should be added here -$ EXTRA_OFILES = "" -$! -$! move to the directory which contains this command procedure -$ old_dir = f$environ("DEFAULT") -$ new_dir = f$parse("_._;",f$environ("PROCEDURE")) - "_._;" -$ set default 'new_dir' -$ -$ ECHO "Starting libiberty build..." -$ create config.h -/* libiberty config.h for VMS */ -#define NEED_sys_siglist -#define NEED_strsignal -#define NEED_psignal -#define NEED_basename -$ LIBR 'WORK_LIB' /Create -$ -$! first pass: compile "required" modules -$ ofiles = REQUIRED_OFILES + " " + EXTRA_OFILES -$ pass = 1 -$ gosub do_ofiles -$ -$! second pass: process dummy.c, using the first pass' results -$ ECHO " now checking run-time library for missing functionality" -$ if f$search("dummy.obj").nes."" then DELETE dummy.obj;* -$ define/noLog sys$error _NL: !can't use /User_Mode here due to gcc -$ define/noLog sys$output _NL: ! driver's use of multiple image activation -$ on error then continue -$ 'CC' dummy.c -$ deassign sys$error !restore, more or less -$ deassign sys$output -$ if f$search("dummy.obj").eqs."" then goto pass2_failure1 -$! link dummy.obj, capturing full linker feedback in dummy.map -$ oldmsg = f$environ("MESSAGE") -$ set message /Facility/Severity/Identification/Text -$ define/User sys$output _NL: -$ define/User sys$error _NL: -$ LINK/Map=dummy.map/noExe dummy.obj,'WORK_LIB'/Libr,- - gnu_cc:[000000]gcclib.olb/Libr,sys$library:vaxcrtl.olb/Libr -$ set message 'oldmsg' -$ if f$search("dummy.map").eqs."" then goto pass2_failure2 -$ DELETE dummy.obj;* -$ SEARCH dummy.map "%LINK-I-UDFSYM" /Output=dummy.list -$ DELETE dummy.map;* -$ ECHO " check completed" -$! we now have a file with one entry per line of unresolvable symbols -$ ofiles = "" -$ if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ -$ open/Read ifile$ dummy.list -$iloop: read/End=idone ifile$ iline -$ iline = f$edit(iline,"COMPRESS,TRIM,LOWERCASE") -$ ofiles = ofiles + " " + f$element(1," ",iline) + ".o" -$ goto iloop -$idone: close ifile$ -$ DELETE dummy.list;* -$ on error then ABORT -$ -$! third pass: compile "missing" modules collected in pass 2 -$ pass = 3 -$ gosub do_ofiles -$ -$! finish up -$ LIBR 'WORK_LIB' /Compress /Output='LIB_NAME' !new-lib.olb -> liberty.olb -$ DELETE 'WORK_LIB';* -$ -$! all done -$ ECHO "Completed libiberty build." -$ type sys$input: - - You many wish to do - $ COPY LIBERTY.OLB GNU_CC:[000000] - so that this run-time library resides in the same location as gcc's - support library. When building gas, be sure to leave the original - copy of liberty.olb here so that gas's build procedure can find it. - -$ set default 'old_dir' -$ exit -$ -$! -$! compile each element of the space-delimited list 'ofiles' -$! -$do_ofiles: -$ ofiles = f$edit(ofiles,"COMPRESS,TRIM") -$ i = 0 -$oloop: -$ f = f$element(i," ",ofiles) -$ if f.eqs." " then goto odone -$ f = f - ".o" !strip dummy suffix -$ ECHO " ''f'" -$ skip_f = 0 -$ if pass.eq.3 .and. f$search("''f'.c").eqs."" then gosub chk_deffunc -$ if .not.skip_f -$ then -$ 'CC' 'f'.c -$ LIBR 'WORK_LIB' 'f'.obj /Insert -$ DELETE 'f'.obj;* -$ endif -$ i = i + 1 -$ goto oloop -$odone: -$ return -$ -$! -$! check functions.def for a DEFFUNC() entry corresponding to missing file 'f'.c -$! -$chk_deffunc: -$ define/User sys$output _NL: -$ define/User sys$error _NL: -$ SEARCH functions.def "DEFFUNC","''f'" /Match=AND -$ if (($status.and.%x7FFFFFFF) .eq. 1) -$ then -$ skip_f = 1 -$ open/Append config_h config.h -$ write config_h "#define NEED_''f'" -$ close config_h -$ endif -$ return -$ -$! -$pass2_failure1: -$! if we reach here, dummy.c failed to compile and we're really stuck -$ type sys$input: - - Cannot compile the library contents checker (dummy.c + functions.def), - so cannot continue! - -$! attempt the compile again, without suppressing diagnostic messages this time -$ on error then ABORT +0*f$verify(v) -$ v = f$verify(1) -$ 'CC' dummy.c -$ ABORT +0*f$verify(v) !'f$verify(0)' -$! -$pass2_failure2: -$! should never reach here.. -$ type sys$input: - - Cannot link the library contents checker (dummy.obj), so cannot continue! - -$! attempt the link again, without suppressing diagnostic messages this time -$ on error then ABORT +0*f$verify(v) -$ v = f$verify(1) -$ LINK/Map=dummy.map/noExe dummy.obj,'WORK_LIB'/Libr,- - gnu_cc:[000000]gcclib.olb/Libr,sys$library:vaxcrtl.olb/Libr -$ ABORT +0*f$verify(v) !'f$verify(0)' -$ -$! not reached -$ exit diff --git a/gnu/egcs/libiberty/vprintf.c b/gnu/egcs/libiberty/vprintf.c deleted file mode 100644 index 65b425a4d6b..00000000000 --- a/gnu/egcs/libiberty/vprintf.c +++ /dev/null @@ -1,15 +0,0 @@ -#ifdef __STDC__ -#include <stdarg.h> -#else -#include <varargs.h> -#endif -#include <stdio.h> -#include <ansidecl.h> -#undef vprintf -int -vprintf (format, ap) - const char *format; - va_list ap; -{ - return vfprintf (stdout, format, ap); -} diff --git a/gnu/egcs/libiberty/vsprintf.c b/gnu/egcs/libiberty/vsprintf.c deleted file mode 100644 index bf0760cf6d3..00000000000 --- a/gnu/egcs/libiberty/vsprintf.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Simple implementation of vsprintf for systems without it. - Highly system-dependent, but should work on most "traditional" - implementations of stdio; newer ones should already have vsprintf. - Written by Per Bothner of Cygnus Support. - Based on libg++'s "form" (written by Doug Lea; dl@rocky.oswego.edu). - Copyright (C) 1991, 1995 Free Software Foundation, Inc. - -This file is part of the libiberty library. This library is free -software; you can redistribute it and/or modify it under the -terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) -any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -As a special exception, if you link this library with files -compiled with a GNU compiler to produce an executable, this does not cause -the resulting executable to be covered by the GNU General Public License. -This exception does not however invalidate any other reasons why -the executable file might be covered by the GNU General Public License. */ - -#include <varargs.h> -#include <stdio.h> -#include <ansidecl.h> -#undef vsprintf - -int -vsprintf (buf, format, ap) - char *buf; - const char *format; - va_list ap; -{ - FILE b; - int ret; -#ifdef VMS - b->_flag = _IOWRT|_IOSTRG; - b->_ptr = buf; - b->_cnt = 12000; -#else - b._flag = _IOWRT|_IOSTRG; - b._ptr = buf; - b._cnt = 12000; -#endif - ret = _doprnt(format, ap, &b); - putc('\0', &b); - return ret; - -} diff --git a/gnu/egcs/libiberty/waitpid.c b/gnu/egcs/libiberty/waitpid.c deleted file mode 100644 index 23db0b932d2..00000000000 --- a/gnu/egcs/libiberty/waitpid.c +++ /dev/null @@ -1,11 +0,0 @@ -int -waitpid (pid, stat_loc, options) - int pid, *stat_loc, options; -{ - for (;;) - { - int wpid = wait(stat_loc); - if (wpid == pid || wpid == -1) - return wpid; - } -} diff --git a/gnu/egcs/libiberty/xatexit.c b/gnu/egcs/libiberty/xatexit.c deleted file mode 100644 index 31476c29ddc..00000000000 --- a/gnu/egcs/libiberty/xatexit.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1990 Regents of the University of California. - * All rights reserved. - * - * %sccs.include.redist.c% - */ - -/* Adapted from newlib/libc/stdlib/{,at}exit.[ch]. - If you use xatexit, you must call xexit instead of exit. */ - -#include "ansidecl.h" -#include "libiberty.h" - -#include <stdio.h> - -#ifdef __STDC__ -#include <stddef.h> -#else -#define size_t unsigned long -#endif - -/* For systems with larger pointers than ints, this must be declared. */ -PTR malloc PARAMS ((size_t)); - -static void xatexit_cleanup PARAMS ((void)); - -/* Pointer to function run by xexit. */ -extern void (*_xexit_cleanup) PARAMS ((void)); - -#define XATEXIT_SIZE 32 - -struct xatexit { - struct xatexit *next; /* next in list */ - int ind; /* next index in this table */ - void (*fns[XATEXIT_SIZE]) PARAMS ((void)); /* the table itself */ -}; - -/* Allocate one struct statically to guarantee that we can register - at least a few handlers. */ -static struct xatexit xatexit_first; - -/* Points to head of LIFO stack. */ -static struct xatexit *xatexit_head = &xatexit_first; - -/* Register function FN to be run by xexit. - Return 0 if successful, -1 if not. */ - -int -xatexit (fn) - void (*fn) PARAMS ((void)); -{ - register struct xatexit *p; - - /* Tell xexit to call xatexit_cleanup. */ - if (!_xexit_cleanup) - _xexit_cleanup = xatexit_cleanup; - - p = xatexit_head; - if (p->ind >= XATEXIT_SIZE) - { - if ((p = (struct xatexit *) malloc (sizeof *p)) == NULL) - return -1; - p->ind = 0; - p->next = xatexit_head; - xatexit_head = p; - } - p->fns[p->ind++] = fn; - return 0; -} - -/* Call any cleanup functions. */ - -static void -xatexit_cleanup () -{ - register struct xatexit *p; - register int n; - - for (p = xatexit_head; p; p = p->next) - for (n = p->ind; --n >= 0;) - (*p->fns[n]) (); -} diff --git a/gnu/egcs/libiberty/xexit.c b/gnu/egcs/libiberty/xexit.c deleted file mode 100644 index 431bbe02991..00000000000 --- a/gnu/egcs/libiberty/xexit.c +++ /dev/null @@ -1,36 +0,0 @@ -/* xexit.c -- Run any exit handlers, then exit. - Copyright (C) 1994, 95, 1997 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If not, write -to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "ansidecl.h" -#include "libiberty.h" - -#include <stdio.h> - -/* This variable is set by xatexit if it is called. This way, xmalloc - doesn't drag xatexit into the link. */ -void (*_xexit_cleanup) PARAMS ((void)); - -void -xexit (code) - int code; -{ - if (_xexit_cleanup != NULL) - (*_xexit_cleanup) (); - exit (code); -} diff --git a/gnu/egcs/libiberty/xmalloc.c b/gnu/egcs/libiberty/xmalloc.c deleted file mode 100644 index 621c6d216c7..00000000000 --- a/gnu/egcs/libiberty/xmalloc.c +++ /dev/null @@ -1,169 +0,0 @@ -/* memory allocation routines with error checking. - Copyright 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "ansidecl.h" -#include "libiberty.h" - -#include <stdio.h> - -#ifdef __STDC__ -#include <stddef.h> -#else -#define size_t unsigned long -#define ptrdiff_t long -#endif - -#if VMS -#include <stdlib.h> -#include <unixlib.h> -#else -/* For systems with larger pointers than ints, these must be declared. */ -PTR malloc PARAMS ((size_t)); -PTR realloc PARAMS ((PTR, size_t)); -PTR calloc PARAMS ((size_t, size_t)); -PTR sbrk PARAMS ((ptrdiff_t)); -#endif - -/* The program name if set. */ -static const char *name = ""; - -#ifdef HAVE_SBRK -/* The initial sbrk, set when the program name is set. Not used for win32 - ports other than cygwin32. */ -static char *first_break = NULL; -#endif /* HAVE_SBRK */ - -void -xmalloc_set_program_name (s) - const char *s; -{ - name = s; -#ifdef HAVE_SBRK - /* Win32 ports other than cygwin32 don't have brk() */ - if (first_break == NULL) - first_break = (char *) sbrk (0); -#endif /* HAVE_SBRK */ -} - -PTR -xmalloc (size) - size_t size; -{ - PTR newmem; - - if (size == 0) - size = 1; - newmem = malloc (size); - if (!newmem) - { -#ifdef HAVE_SBRK - extern char **environ; - size_t allocated; - - if (first_break != NULL) - allocated = (char *) sbrk (0) - first_break; - else - allocated = (char *) sbrk (0) - (char *) &environ; - fprintf (stderr, - "\n%s%sCannot allocate %lu bytes after allocating %lu bytes\n", - name, *name ? ": " : "", - (unsigned long) size, (unsigned long) allocated); -#else /* HAVE_SBRK */ - fprintf (stderr, - "\n%s%sCannot allocate %lu bytes\n", - name, *name ? ": " : "", - (unsigned long) size); -#endif /* HAVE_SBRK */ - xexit (1); - } - return (newmem); -} - -PTR -xcalloc (nelem, elsize) - size_t nelem, elsize; -{ - PTR newmem; - - if (nelem == 0 || elsize == 0) - nelem = elsize = 1; - - newmem = calloc (nelem, elsize); - if (!newmem) - { -#ifdef HAVE_SBRK - extern char **environ; - size_t allocated; - - if (first_break != NULL) - allocated = (char *) sbrk (0) - first_break; - else - allocated = (char *) sbrk (0) - (char *) &environ; - fprintf (stderr, - "\n%s%sCannot allocate %lu bytes after allocating %lu bytes\n", - name, *name ? ": " : "", - (unsigned long) (nelem * elsize), (unsigned long) allocated); -#else /* HAVE_SBRK */ - fprintf (stderr, - "\n%s%sCannot allocate %lu bytes\n", - name, *name ? ": " : "", - (unsigned long) (nelem * elsize)); -#endif /* HAVE_SBRK */ - xexit (1); - } - return (newmem); -} - -PTR -xrealloc (oldmem, size) - PTR oldmem; - size_t size; -{ - PTR newmem; - - if (size == 0) - size = 1; - if (!oldmem) - newmem = malloc (size); - else - newmem = realloc (oldmem, size); - if (!newmem) - { -#ifdef HAVE_SBRK - extern char **environ; - size_t allocated; - - if (first_break != NULL) - allocated = (char *) sbrk (0) - first_break; - else - allocated = (char *) sbrk (0) - (char *) &environ; - fprintf (stderr, - "\n%s%sCannot reallocate %lu bytes after allocating %lu bytes\n", - name, *name ? ": " : "", - (unsigned long) size, (unsigned long) allocated); -#else /* HAVE_SBRK */ - fprintf (stderr, - "\n%s%sCannot reallocate %lu bytes\n", - name, *name ? ": " : "", - (unsigned long) size); -#endif /* HAVE_SBRK */ - xexit (1); - } - return (newmem); -} diff --git a/gnu/egcs/libiberty/xmemdup.c b/gnu/egcs/libiberty/xmemdup.c deleted file mode 100644 index f780041aa13..00000000000 --- a/gnu/egcs/libiberty/xmemdup.c +++ /dev/null @@ -1,22 +0,0 @@ -/* xmemdup.c -- Duplicate a memory buffer, using xcalloc. - This trivial function is in the public domain. - Jeff Garzik, September 1999. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include "ansidecl.h" -#include "libiberty.h" - -#include <sys/types.h> /* For size_t. */ - -PTR -xmemdup (input, copy_size, alloc_size) - const PTR input; - size_t copy_size; - size_t alloc_size; -{ - PTR output = xcalloc (1, alloc_size); - memcpy (output, input, copy_size); - return output; -} diff --git a/gnu/egcs/libiberty/xstrdup.c b/gnu/egcs/libiberty/xstrdup.c deleted file mode 100644 index e16aba08554..00000000000 --- a/gnu/egcs/libiberty/xstrdup.c +++ /dev/null @@ -1,22 +0,0 @@ -/* xstrdup.c -- Duplicate a string in memory, using xmalloc. - This trivial function is in the public domain. - Ian Lance Taylor, Cygnus Support, December 1995. */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#include "ansidecl.h" -#include "libiberty.h" - -char * -xstrdup (s) - const char *s; -{ - register size_t len = strlen (s) + 1; - register char *ret = xmalloc (len); - memcpy (ret, s, len); - return ret; -} diff --git a/gnu/egcs/libiberty/xstrerror.c b/gnu/egcs/libiberty/xstrerror.c deleted file mode 100644 index 770b653ba80..00000000000 --- a/gnu/egcs/libiberty/xstrerror.c +++ /dev/null @@ -1,56 +0,0 @@ -/* xstrerror.c -- jacket routine for more robust strerror() usage. - Fri Jun 16 18:30:00 1995 Pat Rankin <rankin@eql.caltech.edu> - This code is in the public domain. */ - -#include <stdio.h> - -#include "libiberty.h" -#include "config.h" - -#ifdef VMS -#include <errno.h> -#if !defined (__STRICT_ANSI__) && !defined (__HIDE_FORBIDDEN_NAMES) -extern char *strerror PARAMS ((int,...)); -#define DONT_DECLARE_STRERROR -#endif -#endif /* VMS */ - -#ifndef DONT_DECLARE_STRERROR -extern char *strerror PARAMS ((int)); -#endif - -/* If strerror returns NULL, we'll format the number into a static buffer. */ - -#define ERRSTR_FMT "undocumented error #%d" -static char xstrerror_buf[sizeof ERRSTR_FMT + 20]; - -/* Like strerror, but result is never a null pointer. */ - -char * -xstrerror (errnum) - int errnum; -{ - char *errstr; -#ifdef VMS - char *(*vmslib_strerror) PARAMS ((int,...)); - - /* Override any possibly-conflicting declaration from system header. */ - vmslib_strerror = (char *(*) PARAMS ((int,...))) strerror; - /* Second argument matters iff first is EVMSERR, but it's simpler to - pass it unconditionally. `vaxc$errno' is declared in <errno.h> - and maintained by the run-time library in parallel to `errno'. - We assume that `errnum' corresponds to the last value assigned to - errno by the run-time library, hence vaxc$errno will be relevant. */ - errstr = (*vmslib_strerror) (errnum, vaxc$errno); -#else - errstr = strerror (errnum); -#endif - - /* If `errnum' is out of range, result might be NULL. We'll fix that. */ - if (!errstr) - { - sprintf (xstrerror_buf, ERRSTR_FMT, errnum); - errstr = xstrerror_buf; - } - return errstr; -} |