HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Small further clean-up in lib-src/Makefile.in
[bpt/emacs.git]
/
lib-src
/
etags.c
diff --git
a/lib-src/etags.c
b/lib-src/etags.c
index
abc8b06
..
097f684
100644
(file)
--- a/
lib-src/etags.c
+++ b/
lib-src/etags.c
@@
-28,8
+28,7
@@
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-Copyright (C) 1984, 1987, 1988, 1989, 1993, 1994, 1995, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2011
Free Software Foundation, Inc.
This file is not considered part of GNU Emacs.
Free Software Foundation, Inc.
This file is not considered part of GNU Emacs.
@@
-94,8
+93,11
@@
char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
#ifdef HAVE_CONFIG_H
# include <config.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
- /* On some systems, Emacs defines static as nothing for the sake
- of unexec. We don't want that here since we don't use unexec. */
+ /* This is probably not necessary any more. On some systems, config.h
+ used to define static as nothing for the sake of unexec. We don't
+ want that here since we don't use unexec. None of these systems
+ are supported any more, but the idea is still mentioned in
+ etc/PROBLEMS. */
# undef static
# ifndef PTR /* for XEmacs */
# define PTR void *
# undef static
# ifndef PTR /* for XEmacs */
# define PTR void *
@@
-172,9
+174,8
@@
char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
# endif
#endif /* !WINDOWSNT */
# endif
#endif /* !WINDOWSNT */
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#else
+#include <unistd.h>
+#ifndef HAVE_UNISTD_H
# if defined (HAVE_GETCWD) && !defined (WINDOWSNT)
extern char *getcwd (char *buf, size_t size);
# endif
# if defined (HAVE_GETCWD) && !defined (WINDOWSNT)
extern char *getcwd (char *buf, size_t size);
# endif
@@
-192,10
+193,6
@@
char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
# define assert(x) ((void) 0)
#endif
# define assert(x) ((void) 0)
#endif
-#if !defined (S_ISREG) && defined (S_IFREG)
-# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif
-
#ifdef NO_LONG_OPTIONS /* define this if you don't have GNU getopt */
# define NO_LONG_OPTIONS TRUE
# define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr)
#ifdef NO_LONG_OPTIONS /* define this if you don't have GNU getopt */
# define NO_LONG_OPTIONS TRUE
# define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr)
@@
-245,7
+242,6
@@
If you want regular expression support, you should delete this notice and
#define ISLOWER(c) islower (CHAR(c))
#define lowcase(c) tolower (CHAR(c))
#define ISLOWER(c) islower (CHAR(c))
#define lowcase(c) tolower (CHAR(c))
-#define upcase(c) toupper (CHAR(c))
/*
/*
@@
-891,7
+887,7
@@
static void
print_version (void)
{
/* Makes it easier to update automatically. */
print_version (void)
{
/* Makes it easier to update automatically. */
- char emacs_copyright[] = "Copyright (C) 201
0
Free Software Foundation, Inc.";
+ char emacs_copyright[] = "Copyright (C) 201
1
Free Software Foundation, Inc.";
printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION);
puts (emacs_copyright);
printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION);
puts (emacs_copyright);
@@
-3985,10
+3981,8
@@
Yacc_entries (FILE *inf)
static void
just_read_file (FILE *inf)
{
static void
just_read_file (FILE *inf)
{
- register char *dummy;
-
- LOOP_ON_INPUT_LINES (inf, lb, dummy)
- continue;
+ while (!feof (inf))
+ readline (&lb, inf);
}
\f
}
\f
@@
-4205,7
+4199,7
@@
Ada_funcs (FILE *inf)
/* Skip a string i.e. "abcd". */
if (inquote || (*dbp == '"'))
{
/* Skip a string i.e. "abcd". */
if (inquote || (*dbp == '"'))
{
- dbp = etags_strchr (
(inquote) ? dbp : dbp+1
, '"');
+ dbp = etags_strchr (
dbp + !inquote
, '"');
if (dbp != NULL)
{
inquote = FALSE;
if (dbp != NULL)
{
inquote = FALSE;
@@
-5261,16
+5255,16
@@
HTML_labels (FILE *inf)
* Original code by Sunichirou Sugou (1989)
* Rewritten by Anders Lindgren (1996)
*/
* Original code by Sunichirou Sugou (1989)
* Rewritten by Anders Lindgren (1996)
*/
-static
in
t prolog_pr (char *, char *);
+static
size_
t prolog_pr (char *, char *);
static void prolog_skip_comment (linebuffer *, FILE *);
static void prolog_skip_comment (linebuffer *, FILE *);
-static
int prolog_atom (char *, in
t);
+static
size_t prolog_atom (char *, size_
t);
static void
Prolog_functions (FILE *inf)
{
char *cp, *last;
static void
Prolog_functions (FILE *inf)
{
char *cp, *last;
-
in
t len;
-
in
t allocated;
+
size_
t len;
+
size_
t allocated;
allocated = 0;
len = 0;
allocated = 0;
len = 0;
@@
-5327,16
+5321,16
@@
prolog_skip_comment (linebuffer *plb, FILE *inf)
* Return the size of the name of the predicate or rule, or 0 if no
* header was found.
*/
* Return the size of the name of the predicate or rule, or 0 if no
* header was found.
*/
-static
in
t
+static
size_
t
prolog_pr (char *s, char *last)
prolog_pr (char *s, char *last)
-
+
/* Name of last clause. */
{
/* Name of last clause. */
{
-
in
t pos;
-
in
t len;
+
size_
t pos;
+
size_
t len;
pos = prolog_atom (s, 0);
pos = prolog_atom (s, 0);
- if (
pos < 1
)
+ if (
! pos
)
return 0;
len = pos;
return 0;
len = pos;
@@
-5346,7
+5340,7
@@
prolog_pr (char *s, char *last)
|| (s[pos] == '(' && (pos += 1))
|| (s[pos] == ':' && s[pos + 1] == '-' && (pos += 2)))
&& (last == NULL /* save only the first clause */
|| (s[pos] == '(' && (pos += 1))
|| (s[pos] == ':' && s[pos + 1] == '-' && (pos += 2)))
&& (last == NULL /* save only the first clause */
- || len !=
(int)
strlen (last)
+ || len != strlen (last)
|| !strneq (s, last, len)))
{
make_tag (s, len, TRUE, s, pos, lineno, linecharno);
|| !strneq (s, last, len)))
{
make_tag (s, len, TRUE, s, pos, lineno, linecharno);
@@
-5358,17
+5352,17
@@
prolog_pr (char *s, char *last)
/*
* Consume a Prolog atom.
/*
* Consume a Prolog atom.
- * Return the number of bytes consumed, or
-1
if there was an error.
+ * Return the number of bytes consumed, or
0
if there was an error.
*
* A prolog atom, in this context, could be one of:
* - An alphanumeric sequence, starting with a lower case letter.
* - A quoted arbitrary string. Single quotes can escape themselves.
* Backslash quotes everything.
*/
*
* A prolog atom, in this context, could be one of:
* - An alphanumeric sequence, starting with a lower case letter.
* - A quoted arbitrary string. Single quotes can escape themselves.
* Backslash quotes everything.
*/
-static
in
t
-prolog_atom (char *s,
in
t pos)
+static
size_
t
+prolog_atom (char *s,
size_
t pos)
{
{
-
in
t origpos;
+
size_
t origpos;
origpos = pos;
origpos = pos;
@@
-5397,11
+5391,11
@@
prolog_atom (char *s, int pos)
}
else if (s[pos] == '\0')
/* Multiline quoted atoms are ignored. */
}
else if (s[pos] == '\0')
/* Multiline quoted atoms are ignored. */
- return
-1
;
+ return
0
;
else if (s[pos] == '\\')
{
if (s[pos+1] == '\0')
else if (s[pos] == '\\')
{
if (s[pos+1] == '\0')
- return
-1
;
+ return
0
;
pos += 2;
}
else
pos += 2;
}
else
@@
-5410,7
+5404,7
@@
prolog_atom (char *s, int pos)
return pos - origpos;
}
else
return pos - origpos;
}
else
- return
-1
;
+ return
0
;
}
\f
}
\f
@@
-5486,7
+5480,7
@@
Erlang_functions (FILE *inf)
*/
static int
erlang_func (char *s, char *last)
*/
static int
erlang_func (char *s, char *last)
-
+
/* Name of last clause. */
{
int pos;
/* Name of last clause. */
{
int pos;
@@
-6644,7
+6638,7
@@
filename_is_absolute (char *fn)
);
}
);
}
-/*
Up
case DOS drive letter and collapse separators into single slashes.
+/*
Down
case DOS drive letter and collapse separators into single slashes.
Works in place. */
static void
canonicalize_filename (register char *fn)
Works in place. */
static void
canonicalize_filename (register char *fn)
@@
-6654,8
+6648,9
@@
canonicalize_filename (register char *fn)
#ifdef DOS_NT
/* Canonicalize drive letter case. */
#ifdef DOS_NT
/* Canonicalize drive letter case. */
- if (fn[0] != '\0' && fn[1] == ':' && ISLOWER (fn[0]))
- fn[0] = upcase (fn[0]);
+# define ISUPPER(c) isupper (CHAR(c))
+ if (fn[0] != '\0' && fn[1] == ':' && ISUPPER (fn[0]))
+ fn[0] = lowcase (fn[0]);
sep = '\\';
#endif
sep = '\\';
#endif
@@
-6725,7
+6720,4
@@
xrealloc (char *ptr, unsigned int size)
* End:
*/
* End:
*/
-/* arch-tag: 8a9b748d-390c-4922-99db-2eeefa921051
- (do not change this comment) */
-
/* etags.c ends here */
/* etags.c ends here */