summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorFrancesco Potortì <pot@gnu.org>2004-09-08 16:31:35 +0000
committerFrancesco Potortì <pot@gnu.org>2004-09-08 16:31:35 +0000
commitfba74375608bcbf2d970c260037bbc84430e3a13 (patch)
treea4968109339ab1f031d5709198a6d45e9ddb80b7 /lib-src
parentc78d2bbfc47bc47a2b4b92169e867681262aad27 (diff)
downloademacs-fba74375608bcbf2d970c260037bbc84430e3a13.tar.gz
[LONG_OPTIONS]: make it TRUE (ifdef) or FALSE for ease of use.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/etags.c37
2 files changed, 23 insertions, 19 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 4764871fa54..909a5717bcc 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-08 Francesco Potort,Al(B <pot@gnu.org>
+
+ * etags.c: [LONG_OPTIONS]: make it TRUE (ifdef) or FALSE (ifndef)
+ for ease of use.
+
2004-07-17 Richard M. Stallman <rms@gnu.org>
* emacsclient.c (quote_file_name): Pass COPY thru %s to output it.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 829fc97fbfd..094c81e91a0 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -35,7 +35,7 @@
*
*/
-char pot_etags_version[] = "@(#) pot revision number is 16.56";
+char pot_etags_version[] = "@(#) pot revision number is 16.58";
#define TRUE 1
#define FALSE 0
@@ -76,6 +76,13 @@ char pot_etags_version[] = "@(#) pot revision number is 16.56";
# define _GNU_SOURCE 1 /* enables some compiler checks on GNU */
#endif
+#ifdef LONG_OPTIONS
+# undef LONG_OPTIONS
+# define LONG_OPTIONS TRUE
+#else
+# define LONG_OPTIONS FALSE
+#endif
+
/* WIN32_NATIVE is for Xemacs.
MSDOS, WINDOWSNT, DOS_NT are for Emacs. */
#ifdef WIN32_NATIVE
@@ -147,7 +154,7 @@ char pot_etags_version[] = "@(#) pot revision number is 16.56";
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
-#ifdef LONG_OPTIONS
+#if LONG_OPTIONS
# include <getopt.h>
#else
# define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr)
@@ -465,7 +472,7 @@ static bool need_filebuf; /* some regexes are multi-line */
# define need_filebuf FALSE
#endif /* ETAGS_REGEXPS */
-#ifdef LONG_OPTIONS
+#if LONG_OPTIONS
static struct option longopts[] =
{
{ "packages-only", no_argument, &packages_only, TRUE },
@@ -845,12 +852,11 @@ print_help (argbuffer)
printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\
\n\
These are the options accepted by %s.\n", progname, progname);
-#ifdef LONG_OPTIONS
- puts ("You may use unambiguous abbreviations for the long option names.");
-#else
- puts ("Long option names do not work with this executable, as it is not\n\
+ if (LONG_OPTIONS)
+ puts ("You may use unambiguous abbreviations for the long option names.");
+ else
+ puts ("Long option names do not work with this executable, as it is not\n\
linked with GNU getopt.");
-#endif /* LONG_OPTIONS */
puts (" A - as file name means read names from stdin (one per line).\n\
Absolute names are stored in the output file as they are.\n\
Relative ones are stored relative to the output file's directory.\n");
@@ -1158,9 +1164,8 @@ main (argc, argv)
#ifdef ETAGS_REGEXPS
optstring = "-r:Rc:";
#endif /* ETAGS_REGEXPS */
-#ifndef LONG_OPTIONS
- optstring = optstring + 1;
-#endif /* LONG_OPTIONS */
+ if (LONG_OPTIONS)
+ optstring += 1;
optstring = concat (optstring,
"Cf:Il:o:SVhH",
(CTAGS) ? "BxdtTuvw" : "aDi:");
@@ -6475,14 +6480,8 @@ pfatal (s1)
static void
suggest_asking_for_help ()
{
-
-#ifdef LONG_OPTIONS
-fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
- progname, "--help");
-#else
-fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
- progname, "-h");
-#endif
+ fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
+ progname, LONG_OPTIONS ? "--help" : "-h");
exit (EXIT_FAILURE);
}