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,
- 2011 Free Software Foundation, Inc.
+Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2011
+ Free Software Foundation, Inc.
This file is not considered part of GNU Emacs.
# 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)
#define ISLOWER(c) islower (CHAR(c))
#define lowcase(c) tolower (CHAR(c))
-#define upcase(c) toupper (CHAR(c))
/*
* Original code by Sunichirou Sugou (1989)
* Rewritten by Anders Lindgren (1996)
*/
-static int prolog_pr (char *, char *);
+static size_t prolog_pr (char *, char *);
static void prolog_skip_comment (linebuffer *, FILE *);
-static int prolog_atom (char *, int);
+static size_t prolog_atom (char *, size_t);
static void
Prolog_functions (FILE *inf)
{
char *cp, *last;
- int len;
- int allocated;
+ size_t len;
+ size_t allocated;
allocated = 0;
len = 0;
* Return the size of the name of the predicate or rule, or 0 if no
* header was found.
*/
-static int
+static size_t
prolog_pr (char *s, char *last)
-
+
/* Name of last clause. */
{
- int pos;
- int len;
+ size_t pos;
+ size_t len;
pos = prolog_atom (s, 0);
- if (pos < 1)
+ if (! pos)
return 0;
len = pos;
|| (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);
/*
* 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.
*/
-static int
-prolog_atom (char *s, int pos)
+static size_t
+prolog_atom (char *s, size_t pos)
{
- int origpos;
+ size_t origpos;
origpos = pos;
}
else if (s[pos] == '\0')
/* Multiline quoted atoms are ignored. */
- return -1;
+ return 0;
else if (s[pos] == '\\')
{
if (s[pos+1] == '\0')
- return -1;
+ return 0;
pos += 2;
}
else
return pos - origpos;
}
else
- return -1;
+ return 0;
}
\f
*/
static int
erlang_func (char *s, char *last)
-
+
/* Name of last clause. */
{
int pos;
);
}
-/* Upcase DOS drive letter and collapse separators into single slashes.
+/* Downcase DOS drive letter and collapse separators into single slashes.
Works in place. */
static void
canonicalize_filename (register char *fn)
#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