comparison lib-src/etags.c @ 16373:d50369f4bb41

* etags.c (print_version): Print copyright info. * etags.c (print_help): Print the bug reporting address. (main): Use return as the last instruction, instead of exit. * etags.c (main): Don't open the tags file in cxref mode.
author Francesco Potortì <pot@gnu.org>
date Wed, 02 Oct 1996 14:01:24 +0000
parents 33519c691e63
children 675944d1abc9
comparison
equal deleted inserted replaced
16372:e311d5372d8c 16373:d50369f4bb41
29 * Regexp tags by Tom Tromey. 29 * Regexp tags by Tom Tromey.
30 * 30 *
31 * Francesco Potorti` (F.Potorti@cnuce.cnr.it) is the current maintainer. 31 * Francesco Potorti` (F.Potorti@cnuce.cnr.it) is the current maintainer.
32 */ 32 */
33 33
34 char pot_etags_version[] = "@(#) pot revision number is 11.66"; 34 char pot_etags_version[] = "@(#) pot revision number is 11.71";
35 35
36 #define TRUE 1 36 #define TRUE 1
37 #define FALSE 0 37 #define FALSE 0
38 38
39 #ifndef DEBUG 39 #ifndef DEBUG
448 # define VERSION "19" 448 # define VERSION "19"
449 #endif 449 #endif
450 void 450 void
451 print_version () 451 print_version ()
452 { 452 {
453 printf ("%s for Emacs version %s\n", (CTAGS) ? "ctags" : "etags", VERSION); 453 printf ("%s (GNU Emacs %s)\n", (CTAGS) ? "ctags" : "etags", VERSION);
454 puts ("Copyright (C) 1996 Free Software Foundation, Inc. and Ken Arnold");
455 puts ("This program is distributed under the same terms as Emacs");
454 456
455 exit (GOOD); 457 exit (GOOD);
456 } 458 }
457 459
458 void 460 void
547 -h, --help\n\ 549 -h, --help\n\
548 Print this help message."); 550 Print this help message.");
549 551
550 print_language_names (); 552 print_language_names ();
551 553
554 puts ("");
555 puts ("Report bugs to bug-gnu-emacs@prep.ai.mit.edu");
556
552 exit (GOOD); 557 exit (GOOD);
553 } 558 }
554 559
555 560
556 enum argument_type 561 enum argument_type
945 950
946 /* If CTAGS, we are here. process_file did not write the tags yet, 951 /* If CTAGS, we are here. process_file did not write the tags yet,
947 because we want them ordered. Let's do it now. */ 952 because we want them ordered. Let's do it now. */
948 if (cxref_style) 953 if (cxref_style)
949 { 954 {
950 tagf = fopen (tagfile, append_to_tagfile ? "a" : "w");
951 if (tagf == NULL)
952 pfatal (tagfile);
953 put_entries (head); 955 put_entries (head);
954 exit (GOOD); 956 exit (GOOD);
955 } 957 }
956 958
957 if (update) 959 if (update)
980 { 982 {
981 char cmd[BUFSIZ]; 983 char cmd[BUFSIZ];
982 sprintf (cmd, "sort %s -o %s", tagfile, tagfile); 984 sprintf (cmd, "sort %s -o %s", tagfile, tagfile);
983 exit (system (cmd)); 985 exit (system (cmd));
984 } 986 }
985 exit (GOOD); 987 return GOOD;
986 } 988 }
987 989
988 990
989 /* 991 /*
990 * Return a Lang_function given the name. 992 * Return a Lang_function given the name.
4104 { 4106 {
4105 if (p > buffer && p[-1] == '\r') 4107 if (p > buffer && p[-1] == '\r')
4106 { 4108 {
4107 *--p = '\0'; 4109 *--p = '\0';
4108 #ifdef DOS_NT 4110 #ifdef DOS_NT
4109 /* Assume CRLF->LF translation will be performed by Emacs 4111 /* Assume CRLF->LF translation will be performed by Emacs
4110 when loading this file, so CRs won't appear in the buffer. 4112 when loading this file, so CRs won't appear in the buffer.
4111 It would be cleaner to compensate within Emacs; 4113 It would be cleaner to compensate within Emacs;
4112 however, Emacs does not know how many CRs were deleted 4114 however, Emacs does not know how many CRs were deleted
4113 before any given point in the file. */ 4115 before any given point in the file. */
4114 chars_deleted = 1; 4116 chars_deleted = 1;
4115 #else 4117 #else
4116 chars_deleted = 2; 4118 chars_deleted = 2;
4117 #endif 4119 #endif
4118 } 4120 }