comparison lib-src/ebrowse.c @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 23a1cea22d13
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 /* ebrowse.c --- parsing files for the ebrowse C++ browser 1 /* ebrowse.c --- parsing files for the ebrowse C++ browser
2 2
3 Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 3 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
4 2000, 2001, 2002 Free Software Foundation Inc. 4 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6 This file is part of GNU Emacs. 6 This file is part of GNU Emacs.
7 7
8 GNU Emacs is free software; you can redistribute it and/or modify 8 GNU Emacs is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details. 16 GNU General Public License for more details.
17 17
18 You should have received a copy of the GNU General Public License 18 You should have received a copy of the GNU General Public License
19 along with GNU Emacs; see the file COPYING. If not, write to the 19 along with GNU Emacs; see the file COPYING. If not, write to the
20 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02111-1307, USA. */ 21 Boston, MA 02110-1301, USA. */
22 22
23 #ifdef HAVE_CONFIG_H 23 #ifdef HAVE_CONFIG_H
24 #include <config.h> 24 #include <config.h>
25 #endif 25 #endif
26 26
562 { 562 {
563 void *p = malloc (nbytes); 563 void *p = malloc (nbytes);
564 if (p == NULL) 564 if (p == NULL)
565 { 565 {
566 yyerror ("out of memory", NULL); 566 yyerror ("out of memory", NULL);
567 exit (1); 567 exit (EXIT_FAILURE);
568 } 568 }
569 return p; 569 return p;
570 } 570 }
571 571
572 572
579 { 579 {
580 p = realloc (p, sz); 580 p = realloc (p, sz);
581 if (p == NULL) 581 if (p == NULL)
582 { 582 {
583 yyerror ("out of memory", NULL); 583 yyerror ("out of memory", NULL);
584 exit (1); 584 exit (EXIT_FAILURE);
585 } 585 }
586 return p; 586 return p;
587 } 587 }
588 588
589 589
646 for (s = name, h = 0; *s; ++s) 646 for (s = name, h = 0; *s; ++s)
647 h = (h << 1) ^ *s; 647 h = (h << 1) ^ *s;
648 h %= TABLE_SIZE; 648 h %= TABLE_SIZE;
649 649
650 for (sym = class_table[h]; sym; sym = sym->next) 650 for (sym = class_table[h]; sym; sym = sym->next)
651 if (streq (name, sym->name) && sym->namesp == scope) 651 if (streq (name, sym->name)
652 && ((!sym->namesp && !scope)
653 || (sym->namesp && scope
654 && streq (sym->namesp->name, scope->name))))
652 break; 655 break;
653 656
654 if (sym == NULL) 657 if (sym == NULL)
655 { 658 {
656 if (f_very_verbose) 659 if (f_very_verbose)
3669 void 3672 void
3670 usage (error) 3673 usage (error)
3671 int error; 3674 int error;
3672 { 3675 {
3673 puts (USAGE); 3676 puts (USAGE);
3674 exit (error ? 1 : 0); 3677 exit (error ? EXIT_FAILURE : EXIT_SUCCESS);
3675 } 3678 }
3676 3679
3677 3680
3678 /* Display version and copyright info. The VERSION macro is set 3681 /* Display version and copyright info. The VERSION macro is set
3679 from the Makefile and contains the Emacs version. */ 3682 from the Makefile and contains the Emacs version. */
3686 version () 3689 version ()
3687 { 3690 {
3688 printf ("ebrowse %s\n", VERSION); 3691 printf ("ebrowse %s\n", VERSION);
3689 puts ("Copyright (C) 1992-1999, 2000, 2001 Free Software Foundation, Inc."); 3692 puts ("Copyright (C) 1992-1999, 2000, 2001 Free Software Foundation, Inc.");
3690 puts ("This program is distributed under the same terms as Emacs."); 3693 puts ("This program is distributed under the same terms as Emacs.");
3691 exit (0); 3694 exit (EXIT_SUCCESS);
3692 } 3695 }
3693 3696
3694 3697
3695 /* Parse one input file FILE, adding classes and members to the symbol 3698 /* Parse one input file FILE, adding classes and members to the symbol
3696 table. */ 3699 table. */
3923 3926
3924 yyout = fopen (out_filename, f_append ? "a" : "w"); 3927 yyout = fopen (out_filename, f_append ? "a" : "w");
3925 if (yyout == NULL) 3928 if (yyout == NULL)
3926 { 3929 {
3927 yyerror ("cannot open output file `%s'", out_filename); 3930 yyerror ("cannot open output file `%s'", out_filename);
3928 exit (1); 3931 exit (EXIT_FAILURE);
3929 } 3932 }
3930 } 3933 }
3931 3934
3932 /* Process input files specified on the command line. */ 3935 /* Process input files specified on the command line. */
3933 while (optind < argc) 3936 while (optind < argc)
3968 3971
3969 /* Close output file. */ 3972 /* Close output file. */
3970 if (yyout != stdout) 3973 if (yyout != stdout)
3971 fclose (yyout); 3974 fclose (yyout);
3972 3975
3973 return 0; 3976 return EXIT_SUCCESS;
3974 } 3977 }
3975 3978
3976 3979 /* arch-tag: fc03b4bc-91a9-4c3d-b3b9-12a77fa86dd8
3977 /* ebrowse.c ends here. */ 3980 (do not change this comment) */
3981
3982 /* ebrowse.c ends here */