-/* Tags file maker to go with GNU Emacs -*- coding: latin-1 -*-
+/* Tags file maker to go with GNU Emacs -*- coding: utf-8 -*-
Copyright (C) 1984 The Regents of the University of California
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2013 Free Software
+Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2014 Free Software
Foundation, Inc.
This file is not considered part of GNU Emacs.
* 1985 Emacs TAGS format by Richard Stallman.
* 1989 Sam Kendall added C++.
* 1992 Joseph B. Wells improved C and C++ parsing.
- * 1993 Francesco Potortì reorganized C and C++.
+ * 1993 Francesco Potortì reorganized C and C++.
* 1994 Line-by-line regexp tags by Tom Tromey.
- * 2001 Nested classes by Francesco Potortì (concept by Mykola Dzyuba).
- * 2002 #line directives by Francesco Potortì.
+ * 2001 Nested classes by Francesco Potortì (concept by Mykola Dzyuba).
+ * 2002 #line directives by Francesco Potortì.
*
- * Francesco Potortì <pot@gnu.org> has maintained and improved it since 1993.
+ * Francesco Potortì <pot@gnu.org> has maintained and improved it since 1993.
*/
/*
char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
-#define TRUE 1
-#define FALSE 0
-
#ifdef DEBUG
# undef DEBUG
-# define DEBUG TRUE
+# define DEBUG true
#else
-# define DEBUG FALSE
+# define DEBUG false
# define NDEBUG /* disable assert */
#endif
#ifdef MSDOS
# undef MSDOS
-# define MSDOS TRUE
+# define MSDOS true
# include <fcntl.h>
# include <sys/param.h>
# include <io.h>
#else
-# define MSDOS FALSE
+# define MSDOS false
#endif /* MSDOS */
#ifdef WINDOWSNT
tag tables and tags typedefs, #defines and struct/union/enum by default. */
#ifdef CTAGS
# undef CTAGS
-# define CTAGS TRUE
+# define CTAGS true
#else
-# define CTAGS FALSE
+# define CTAGS false
#endif
#define streq(s,t) (assert ((s)!=NULL || (t)!=NULL), !strcmp (s, t))
(char *) (op), (n) * sizeof (Type)))
#endif
-#define bool int
-
typedef void Lang_function (FILE *);
typedef struct
static void Yacc_entries (FILE *);
static void just_read_file (FILE *);
-static void print_language_names (void);
-static void print_version (void);
-static void print_help (argument *);
-int main (int, char **);
-
-static compressor *get_compressor_from_suffix (char *, char **);
static language *get_language_from_langname (const char *);
-static language *get_language_from_interpreter (char *);
-static language *get_language_from_filename (char *, bool);
static void readline (linebuffer *, FILE *);
static long readline_internal (linebuffer *, FILE *);
static bool nocase_tail (const char *);
static void free_tree (node *);
static void free_fdesc (fdesc *);
static void pfnote (char *, bool, char *, int, int, long);
-static void make_tag (const char *, int, bool, char *, int, int, long);
static void invalidate_nodes (fdesc *, node **);
static void put_entries (node *);
*midtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789";
static bool append_to_tagfile; /* -a: append to tags */
-/* The next five default to TRUE in C and derived languages. */
+/* The next five default to true in C and derived languages. */
static bool typedefs; /* -t: create tags for C and Ada typedefs */
static bool typedefs_or_cplusplus; /* -T: create tags for C typedefs, level */
/* 0 struct/enum/union decls, and C++ */
static bool constantypedefs; /* -d: create tags for C #define, enum */
/* constants and variables. */
/* -D: opposite of -d. Default under ctags. */
-static bool globals; /* create tags for global variables */
-static bool members; /* create tags for C member variables */
-static bool declarations; /* --declarations: tag them and extern in C&Co*/
-static bool no_line_directive; /* ignore #line directives (undocumented) */
-static bool no_duplicates; /* no duplicate tags for ctags (undocumented) */
+static int globals; /* create tags for global variables */
+static int members; /* create tags for C member variables */
+static int declarations; /* --declarations: tag them and extern in C&Co*/
+static int no_line_directive; /* ignore #line directives (undocumented) */
+static int no_duplicates; /* no duplicate tags for ctags (undocumented) */
static bool update; /* -u: update tags */
static bool vgrind_style; /* -v: create vgrind style index output */
static bool no_warnings; /* -w: suppress warnings (undocumented) */
static bool cxref_style; /* -x: create cxref style output */
static bool cplusplus; /* .[hc] means C++, not C (undocumented) */
static bool ignoreindent; /* -I: ignore indentation in C */
-static bool packages_only; /* --packages-only: in Ada, only tag packages*/
+static int packages_only; /* --packages-only: in Ada, only tag packages*/
/* STDIN is defined in LynxOS system headers */
#ifdef STDIN
static struct option longopts[] =
{
{ "append", no_argument, NULL, 'a' },
- { "packages-only", no_argument, &packages_only, TRUE },
+ { "packages-only", no_argument, &packages_only, 1 },
{ "c++", no_argument, NULL, 'C' },
- { "declarations", no_argument, &declarations, TRUE },
- { "no-line-directive", no_argument, &no_line_directive, TRUE },
- { "no-duplicates", no_argument, &no_duplicates, TRUE },
+ { "declarations", no_argument, &declarations, 1 },
+ { "no-line-directive", no_argument, &no_line_directive, 1 },
+ { "no-duplicates", no_argument, &no_duplicates, 1 },
{ "help", no_argument, NULL, 'h' },
{ "help", no_argument, NULL, 'H' },
{ "ignore-indentation", no_argument, NULL, 'I' },
{ "language", required_argument, NULL, 'l' },
- { "members", no_argument, &members, TRUE },
- { "no-members", no_argument, &members, FALSE },
+ { "members", no_argument, &members, 1 },
+ { "no-members", no_argument, &members, 0 },
{ "output", required_argument, NULL, 'o' },
{ "regex", required_argument, NULL, 'r' },
{ "no-regex", no_argument, NULL, 'R' },
{ "backward-search", no_argument, NULL, 'B' },
{ "cxref", no_argument, NULL, 'x' },
{ "defines", no_argument, NULL, 'd' },
- { "globals", no_argument, &globals, TRUE },
+ { "globals", no_argument, &globals, 1 },
{ "typedefs", no_argument, NULL, 't' },
{ "typedefs-and-c++", no_argument, NULL, 'T' },
{ "update", no_argument, NULL, 'u' },
#else /* Etags options */
{ "no-defines", no_argument, NULL, 'D' },
- { "no-globals", no_argument, &globals, FALSE },
+ { "no-globals", no_argument, &globals, 0 },
{ "include", required_argument, NULL, 'i' },
#endif
{ NULL }
{ "scheme", Scheme_help, Scheme_functions, Scheme_suffixes },
{ "tex", TeX_help, TeX_commands, TeX_suffixes },
{ "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes },
- { "yacc", Yacc_help,Yacc_entries,Yacc_suffixes,NULL,NULL,TRUE},
+ { "yacc", Yacc_help,Yacc_entries,Yacc_suffixes,NULL,NULL,true},
{ "auto", auto_help }, /* default guessing scheme */
{ "none", none_help, just_read_file }, /* regexp matching only */
{ NULL } /* end of list */
#ifndef VERSION
# define VERSION "17.38.1.4"
#endif
-static void
+static _Noreturn void
print_version (void)
{
char emacs_copyright[] = COPYRIGHT;
}
#ifndef PRINT_UNDOCUMENTED_OPTIONS_HELP
-# define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE
+# define PRINT_UNDOCUMENTED_OPTIONS_HELP false
#endif
-static void
+static _Noreturn void
print_help (argument *argbuffer)
{
- bool help_for_lang = FALSE;
+ bool help_for_lang = false;
for (; argbuffer->arg_type != at_end; argbuffer++)
if (argbuffer->arg_type == at_language)
if (help_for_lang)
puts ("");
puts (argbuffer->lang->help);
- help_for_lang = TRUE;
+ help_for_lang = true;
}
if (help_for_lang)
argument *argbuffer;
int current_arg, file_count;
linebuffer filename_lb;
- bool help_asked = FALSE;
+ bool help_asked = false;
ptrdiff_t len;
char *optstring;
int opt;
* Also default to find macro constants, enum constants, struct
* members and global variables. Do it for both etags and ctags.
*/
- typedefs = typedefs_or_cplusplus = constantypedefs = TRUE;
- globals = members = TRUE;
+ typedefs = typedefs_or_cplusplus = constantypedefs = true;
+ globals = members = true;
/* When the optstring begins with a '-' getopt_long does not rearrange the
non-options arguments to be at the end, but leaves them alone. */
++file_count;
if (parsing_stdin)
fatal ("cannot parse standard input more than once", (char *)NULL);
- parsing_stdin = TRUE;
+ parsing_stdin = true;
break;
/* Common options. */
- case 'a': append_to_tagfile = TRUE; break;
- case 'C': cplusplus = TRUE; break;
+ case 'a': append_to_tagfile = true; break;
+ case 'C': cplusplus = true; break;
case 'f': /* for compatibility with old makefiles */
case 'o':
if (tagfile)
break;
case 'I':
case 'S': /* for backward compatibility */
- ignoreindent = TRUE;
+ ignoreindent = true;
break;
case 'l':
{
break;
case 'h':
case 'H':
- help_asked = TRUE;
+ help_asked = true;
break;
/* Etags options */
- case 'D': constantypedefs = FALSE; break;
+ case 'D': constantypedefs = false; break;
case 'i': included_files[nincluded_files++] = optarg; break;
/* Ctags options. */
case 'B': searchar = '?'; break;
- case 'd': constantypedefs = TRUE; break;
- case 't': typedefs = TRUE; break;
- case 'T': typedefs = typedefs_or_cplusplus = TRUE; break;
- case 'u': update = TRUE; break;
- case 'v': vgrind_style = TRUE; /*FALLTHRU*/
- case 'x': cxref_style = TRUE; break;
- case 'w': no_warnings = TRUE; break;
+ case 'd': constantypedefs = true; break;
+ case 't': typedefs = true; break;
+ case 'T': typedefs = typedefs_or_cplusplus = true; break;
+ case 'u': update = true; break;
+ case 'v': vgrind_style = true; /*FALLTHRU*/
+ case 'x': cxref_style = true; break;
+ case 'w': no_warnings = true; break;
default:
suggest_asking_for_help ();
/* NOTREACHED */
fatal ("failed to execute shell command", (char *)NULL);
}
free (cmd);
- append_to_tagfile = TRUE;
+ append_to_tagfile = true;
}
tagf = fopen (tagfile, append_to_tagfile ? "a" : "w");
to the directory of the tags file. */
fdp->taggedfname = relative_filename (fn, tagfiledir);
}
- fdp->usecharno = TRUE; /* use char position when making tags */
+ fdp->usecharno = true; /* use char position when making tags */
fdp->prop = NULL;
- fdp->written = FALSE; /* not written on tags file yet */
+ fdp->written = false; /* not written on tags file yet */
fdhead = fdp;
curfdp = fdhead; /* the current file description */
* This routine sets up the boolean pseudo-functions which work
* by setting boolean flags dependent upon the corresponding character.
* Every char which is NOT in that string is not a white char. Therefore,
- * all of the array "_wht" is set to FALSE, and then the elements
- * subscripted by the chars in "white" are set to TRUE. Thus "_wht"
- * of a char is TRUE if it is the string "white", else FALSE.
+ * all of the array "_wht" is set to false, and then the elements
+ * subscripted by the chars in "white" are set to true. Thus "_wht"
+ * of a char is true if it is the string "white", else false.
*/
static void
init (void)
{
- register const char *sp;
- register int i;
+ const char *sp;
+ int i;
for (i = 0; i < CHARS; i++)
- iswhite (i) = notinname (i) = begtoken (i) = intoken (i) = endtoken (i) = FALSE;
- for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = TRUE;
- for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = TRUE;
+ iswhite (i) = notinname (i) = begtoken (i) = intoken (i) = endtoken (i)
+ = false;
+ for (sp = white; *sp != '\0'; sp++) iswhite (*sp) = true;
+ for (sp = nonam; *sp != '\0'; sp++) notinname (*sp) = true;
notinname ('\0') = notinname ('\n');
- for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = TRUE;
+ for (sp = begtk; *sp != '\0'; sp++) begtoken (*sp) = true;
begtoken ('\0') = begtoken ('\n');
- for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = TRUE;
+ for (sp = midtk; *sp != '\0'; sp++) intoken (*sp) = true;
intoken ('\0') = intoken ('\n');
- for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = TRUE;
+ for (sp = endtk; *sp != '\0'; sp++) endtoken (*sp) = true;
endtoken ('\0') = endtoken ('\n');
}
/* Else try to guess the language given the file name. */
if (parser == NULL)
{
- lang = get_language_from_filename (curfdp->infname, TRUE);
+ lang = get_language_from_filename (curfdp->infname, true);
if (lang != NULL && lang->function != NULL)
{
curfdp->lang = lang;
/* Else try to guess the language given the case insensitive file name. */
if (parser == NULL)
{
- lang = get_language_from_filename (curfdp->infname, FALSE);
+ lang = get_language_from_filename (curfdp->infname, false);
if (lang != NULL && lang->function != NULL)
{
curfdp->lang = lang;
static void
make_tag (const char *name, /* tag name, or NULL if unnamed */
int namelen, /* tag length */
- int is_func, /* tag is a function */
+ bool is_func, /* tag is a function */
char *linestart, /* start of the line where tag is */
int linelen, /* length of the line where tag is */
int lno, /* line number */
&& (cp == linestart
|| notinname (cp[-1])) /* rule #3 */
&& strneq (name, cp, namelen)) /* rule #2 */
- named = FALSE; /* use implicit tag name */
+ named = false; /* use implicit tag name */
}
}
/* Record a tag. */
static void
-pfnote (char *name, int is_func, char *linestart, int linelen, int lno, long int cno)
+pfnote (char *name, bool is_func, char *linestart, int linelen, int lno,
+ long int cno)
/* tag name, or NULL if unnamed */
/* tag is a function */
/* start of the line where tag is */
}
else
np->name = name;
- np->valid = TRUE;
- np->been_warned = FALSE;
+ np->valid = true;
+ np->been_warned = false;
np->fdp = curfdp;
np->is_func = is_func;
np->lno = lno;
(stderr,
"Duplicate entry in files %s and %s: %s (Warning only)\n",
np->fdp->infname, cur_node->fdp->infname, np->name);
- cur_node->been_warned = TRUE;
+ cur_node->been_warned = true;
}
return;
}
if (np->left != NULL)
invalidate_nodes (badfdp, &np->left);
if (np->fdp == badfdp)
- np->valid = FALSE;
+ np->valid = false;
if (np->right != NULL)
invalidate_nodes (badfdp, &np->right);
}
fdp = np->fdp;
fprintf (tagf, "\f\n%s,%d\n",
fdp->taggedfname, total_size_of_entries (np));
- fdp->written = TRUE;
+ fdp->written = true;
}
fputs (np->regex, tagf);
fputc ('\177', tagf);
st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef
};
-static unsigned int hash (const char *, unsigned int);
-static struct C_stab_entry * in_word_set (const char *, unsigned int);
-static enum sym_type C_symtype (char *, int, int);
-
/* Feed stuff between (but not including) %[ and %] lines to:
gperf -m 5
%[
struct C_stab_entry { const char *name; int c_ext; enum sym_type type; };
/* maximum key range = 33, duplicates = 0 */
-static inline unsigned int
-hash (register const char *str, register unsigned int len)
+static int
+hash (const char *str, int len)
{
- static unsigned char asso_values[] =
+ static char const asso_values[] =
{
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35
};
- register int hval = len;
+ int hval = len;
switch (hval)
{
default:
- hval += asso_values[(unsigned char)str[2]];
+ hval += asso_values[(unsigned char) str[2]];
/*FALLTHROUGH*/
case 2:
- hval += asso_values[(unsigned char)str[1]];
+ hval += asso_values[(unsigned char) str[1]];
break;
}
return hval;
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
- register int key = hash (str, len);
+ int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
- register const char *s = wordlist[key].name;
+ const char *s = wordlist[key].name;
if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
return &wordlist[key];
* function or variable, or corresponds to a typedef, or
* is a struct/union/enum tag, or #define, or an enum constant.
*
- * *IS_FUNC gets TRUE if the token is a function or #define macro
+ * *IS_FUNC_OR_VAR gets true if the token is a function or #define macro
* with args. C_EXTP points to which language we are looking at.
*
* Globals
*/
static bool
-consider_token (register char *str, register int len, register int c, int *c_extp, int bracelev, int parlev, int *is_func_or_var)
+consider_token (char *str, int len, int c, int *c_extp,
+ int bracelev, int parlev, bool *is_func_or_var)
/* IN: token pointer */
/* IN: token length */
/* IN: first char after the token */
*/
if (toktype == st_C_attribute)
{
- inattribute = TRUE;
- return FALSE;
+ inattribute = true;
+ return false;
}
/*
if (toktype == st_C_gnumacro)
{
fvdef = fdefunkey;
- return FALSE;
+ return false;
}
break;
case dsharpseen:
{
definedef = dignorerest;
}
- return FALSE;
+ return false;
case ddefineseen:
/*
* Make a tag for any macro, unless it is a constant
- * and constantypedefs is FALSE.
+ * and constantypedefs is false.
*/
definedef = dignorerest;
*is_func_or_var = (c == '(');
if (!*is_func_or_var && !constantypedefs)
- return FALSE;
+ return false;
else
- return TRUE;
+ return true;
case dignorerest:
- return FALSE;
+ return false;
default:
error ("internal error: definedef value.");
}
{
if (typedefs)
typdef = tkeyseen;
- fvextern = FALSE;
+ fvextern = false;
fvdef = fvnone;
- return FALSE;
+ return false;
}
break;
case tkeyseen:
if (structdef == snone && fvdef == fvnone)
{
fvdef = fvnameseen;
- return TRUE;
+ return true;
}
break;
case tend:
case st_C_class:
case st_C_struct:
case st_C_enum:
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
switch (toktype)
case st_C_javastruct:
if (structdef == stagseen)
structdef = scolonseen;
- return FALSE;
+ return false;
case st_C_template:
case st_C_class:
if ((*c_extp & C_AUTO) /* automatic detection of C++ language */
if (fvdef == fvnameseen)
fvdef = fvnone;
}
- return FALSE;
+ return false;
}
if (structdef == skeyseen)
{
structdef = stagseen;
- return TRUE;
+ return true;
}
if (typdef != tnone)
{
case st_C_objprot:
objdef = oprotocol;
- return FALSE;
+ return false;
case st_C_objimpl:
objdef = oimplementation;
- return FALSE;
+ return false;
}
break;
case oimplementation:
/* Save the class tag for functions or variables defined inside. */
objtag = savenstr (str, len);
objdef = oinbody;
- return FALSE;
+ return false;
case oprotocol:
/* Save the class tag for categories. */
objtag = savenstr (str, len);
objdef = otagseen;
- *is_func_or_var = TRUE;
- return TRUE;
+ *is_func_or_var = true;
+ return true;
case oparenseen:
objdef = ocatseen;
- *is_func_or_var = TRUE;
- return TRUE;
+ *is_func_or_var = true;
+ return true;
case oinbody:
break;
case omethodsign:
linebuffer_setlen (&token_name, len);
memcpy (token_name.buffer, str, len);
token_name.buffer[len] = '\0';
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
case omethodcolon:
if (parlev == 0)
objdef = omethodparm;
- return FALSE;
+ return false;
case omethodparm:
if (parlev == 0)
{
linebuffer_setlen (&token_name, oldlen + len);
memcpy (token_name.buffer + oldlen, str, len);
token_name.buffer[oldlen + len] = '\0';
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
case oignore:
if (toktype == st_C_objend)
{
free (objtag); */
objdef = onone;
}
- return FALSE;
+ return false;
}
/* A function, variable or enum constant? */
switch (toktype)
{
case st_C_extern:
- fvextern = TRUE;
+ fvextern = true;
switch (fvdef)
{
case finlist:
default:
fvdef = fvnone;
}
- return FALSE;
+ return false;
case st_C_ignore:
- fvextern = FALSE;
+ fvextern = false;
fvdef = vignore;
- return FALSE;
+ return false;
case st_C_operator:
fvdef = foperator;
- *is_func_or_var = TRUE;
- return TRUE;
+ *is_func_or_var = true;
+ return true;
case st_none:
if (constantypedefs
&& structdef == snone
&& structtype == st_C_enum && bracelev > structbracelev)
- return TRUE; /* enum constant */
+ return true; /* enum constant */
switch (fvdef)
{
case fdefunkey:
if (bracelev > 0)
break;
fvdef = fdefunname; /* GNU macro */
- *is_func_or_var = TRUE;
- return TRUE;
+ *is_func_or_var = true;
+ return true;
case fvnone:
switch (typdef)
{
case ttypeseen:
- return FALSE;
+ return false;
case tnone:
if ((strneq (str, "asm", 3) && endtoken (str[3]))
|| (strneq (str, "__asm__", 7) && endtoken (str[7])))
{
fvdef = vignore;
- return FALSE;
+ return false;
}
break;
}
if (*c_extp & C_AUTO) /* automatic detection of C++ */
*c_extp = (*c_extp | C_PLPL) & ~C_AUTO;
fvdef = foperator;
- *is_func_or_var = TRUE;
- return TRUE;
+ *is_func_or_var = true;
+ return true;
}
if (bracelev > 0 && !instruct)
break;
fvdef = fvnameseen; /* function or variable */
- *is_func_or_var = TRUE;
- return TRUE;
+ *is_func_or_var = true;
+ return true;
}
break;
}
- return FALSE;
+ return false;
}
\f
curlinepos = charno; \
readline (&curlb, inf); \
lp = curlb.buffer; \
- quotednl = FALSE; \
+ quotednl = false; \
newndx = curndx; \
} while (0)
if (savetoken.valid) \
{ \
token = savetoken; \
- savetoken.valid = FALSE; \
+ savetoken.valid = false; \
} \
definedef = dnone; \
} while (0)
static void
-make_C_tag (int isfun)
+make_C_tag (bool isfun)
{
- /* This function is never called when token.valid is FALSE, but
+ /* This function is never called when token.valid is false, but
we must protect against invalid input or internal errors. */
if (token.valid)
make_tag (token_name.buffer, token_name.len, isfun, token.line,
error ("INVALID TOKEN");
}
- token.valid = FALSE;
+ token.valid = false;
}
lp = curlb.buffer;
*lp = 0;
- fvdef = fvnone; fvextern = FALSE; typdef = tnone;
+ fvdef = fvnone; fvextern = false; typdef = tnone;
structdef = snone; definedef = dnone; objdef = onone;
- yacc_rules = FALSE;
- midtoken = inquote = inchar = incomm = quotednl = FALSE;
- token.valid = savetoken.valid = FALSE;
+ yacc_rules = false;
+ midtoken = inquote = inchar = incomm = quotednl = false;
+ token.valid = savetoken.valid = false;
bracelev = bracketlev = parlev = attrparlev = templatelev = 0;
if (cjava)
{ qualifier = "."; qlen = 1; }
to read the next line. */
if (*lp == '\0')
{
- quotednl = TRUE;
+ quotednl = true;
continue;
}
lp++;
if (*lp == '/')
{
c = *lp++;
- incomm = FALSE;
+ incomm = false;
}
break;
case '\0':
switch (c)
{
case '"':
- inquote = FALSE;
+ inquote = false;
break;
case '\0':
/* Newlines inside strings do not end macro definitions
CNL ();
/* FALLTHRU */
case '\'':
- inchar = FALSE;
+ inchar = false;
break;
}
continue;
else switch (c)
{
case '"':
- inquote = TRUE;
+ inquote = true;
if (bracketlev > 0)
continue;
if (inattribute)
case vignore:
break;
default:
- fvextern = FALSE;
+ fvextern = false;
fvdef = fvnone;
}
continue;
case '\'':
- inchar = TRUE;
+ inchar = true;
if (bracketlev > 0)
continue;
if (inattribute)
break;
if (fvdef != finlist && fvdef != fignore && fvdef != vignore)
{
- fvextern = FALSE;
+ fvextern = false;
fvdef = fvnone;
}
continue;
case '/':
if (*lp == '*')
{
- incomm = TRUE;
+ incomm = true;
lp++;
c = ' ';
if (bracketlev > 0)
{
/* Entering or exiting rules section in yacc file. */
lp++;
- definedef = dnone; fvdef = fvnone; fvextern = FALSE;
+ definedef = dnone; fvdef = fvnone; fvextern = false;
typdef = tnone; structdef = snone;
- midtoken = inquote = inchar = incomm = quotednl = FALSE;
+ midtoken = inquote = inchar = incomm = quotednl = false;
bracelev = 0;
yacc_rules = !yacc_rules;
continue;
if (definedef == dnone)
{
char *cp;
- bool cpptoken = TRUE;
+ bool cpptoken = true;
/* Look back on this line. If all blanks, or nonblanks
followed by an end of comment, this is a preprocessor
if (*cp == '*' && cp[1] == '/')
{
cp++;
- cpptoken = TRUE;
+ cpptoken = true;
}
else
- cpptoken = FALSE;
+ cpptoken = false;
}
if (cpptoken)
definedef = dsharpseen;
}
else
{
- bool funorvar = FALSE;
+ bool funorvar = false;
if (yacc_rules
|| consider_token (newlb.buffer + tokoff, toklen, c,
c = *lp++;
toklen += lp - oldlp;
}
- token.named = FALSE;
+ token.named = false;
if (!plainc
&& nestlev > 0 && definedef == dnone)
/* in struct body */
linebuffer_setlen (&token_name, len+qlen+toklen);
sprintf (token_name.buffer + len, "%s%.*s",
qualifier, toklen, newlb.buffer + tokoff);
- token.named = TRUE;
+ token.named = true;
}
else if (objdef == ocatseen)
/* Objective C category */
linebuffer_setlen (&token_name, len);
sprintf (token_name.buffer, "%s(%.*s)",
objtag, toklen, newlb.buffer + tokoff);
- token.named = TRUE;
+ token.named = true;
}
else if (objdef == omethodtag
|| objdef == omethodparm)
/* Objective C method */
{
- token.named = TRUE;
+ token.named = true;
}
else if (fvdef == fdefunname)
/* GNU DEFUN and similar macros */
token.length = toklen;
token.line = newlb.buffer;
token.linepos = newlinepos;
- token.valid = TRUE;
+ token.valid = true;
if (definedef == dnone
&& (fvdef == fvnameseen
fvdef = fvnone;
}
}
- midtoken = FALSE;
+ midtoken = false;
}
} /* if (endtoken (c)) */
else if (intoken (c))
case flistseen:
if (plainc || declarations)
{
- make_C_tag (TRUE); /* a function */
+ make_C_tag (true); /* a function */
fvdef = fignore;
}
break;
{
tokoff = lp - 1 - newlb.buffer;
toklen = 1;
- midtoken = TRUE;
+ midtoken = true;
}
continue;
} /* if (begtoken) */
break;
if (yacc_rules && token.offset == 0 && token.valid)
{
- make_C_tag (FALSE); /* a yacc function */
+ make_C_tag (false); /* a yacc function */
break;
}
if (definedef != dnone)
{
case otagseen:
objdef = oignore;
- make_C_tag (TRUE); /* an Objective C class */
+ make_C_tag (true); /* an Objective C class */
break;
case omethodtag:
case omethodparm:
/* Should be useless, but may be work as a safety net. */
if (cplpl && fvdef == flistseen)
{
- make_C_tag (TRUE); /* a function */
+ make_C_tag (true); /* a function */
fvdef = fignore;
break;
}
{
case tend:
case ttypeseen:
- make_C_tag (FALSE); /* a typedef */
+ make_C_tag (false); /* a typedef */
typdef = tnone;
fvdef = fvnone;
break;
case fvnameseen:
if ((globals && bracelev == 0 && (!fvextern || declarations))
|| (members && instruct))
- make_C_tag (FALSE); /* a variable */
- fvextern = FALSE;
+ make_C_tag (false); /* a variable */
+ fvextern = false;
fvdef = fvnone;
- token.valid = FALSE;
+ token.valid = false;
break;
case flistseen:
if ((declarations
&& (typdef == tnone || (typdef != tignore && instruct)))
|| (members
&& plainc && instruct))
- make_C_tag (TRUE); /* a function */
+ make_C_tag (true); /* a function */
/* FALLTHRU */
default:
- fvextern = FALSE;
+ fvextern = false;
fvdef = fvnone;
if (declarations
&& cplpl && structdef == stagseen)
- make_C_tag (FALSE); /* forward declaration */
+ make_C_tag (false); /* forward declaration */
else
- token.valid = FALSE;
+ token.valid = false;
} /* switch (fvdef) */
/* FALLTHRU */
default:
{
case omethodtag:
case omethodparm:
- make_C_tag (TRUE); /* an Objective C method */
+ make_C_tag (true); /* an Objective C method */
objdef = oinbody;
break;
}
&& templatelev == 0
&& (!fvextern || declarations))
|| (members && instruct)))
- make_C_tag (FALSE); /* a variable */
+ make_C_tag (false); /* a variable */
break;
case flistseen:
if ((declarations && typdef == tnone && !instruct)
|| (members && typdef != tignore && instruct))
{
- make_C_tag (TRUE); /* a function */
+ make_C_tag (true); /* a function */
fvdef = fvnameseen;
}
else if (!declarations)
fvdef = fvnone;
- token.valid = FALSE;
+ token.valid = false;
break;
default:
fvdef = fvnone;
case ttypeseen:
case tend:
typdef = tignore;
- make_C_tag (FALSE); /* a typedef */
+ make_C_tag (false); /* a typedef */
break;
case tnone:
case tinbody:
if ((members && bracelev == 1)
|| (globals && bracelev == 0
&& (!fvextern || declarations)))
- make_C_tag (FALSE); /* a variable */
+ make_C_tag (false); /* a variable */
/* FALLTHRU */
default:
fvdef = fvnone;
{
/* This handles constructs like:
typedef void OperatorFun (int fun); */
- make_C_tag (FALSE);
+ make_C_tag (false);
typdef = tignore;
fvdef = fignore;
break;
if (inattribute)
{
if (--attrparlev == 0)
- inattribute = FALSE;
+ inattribute = false;
break;
}
if (definedef != dnone)
break;
if (objdef == ocatseen && parlev == 1)
{
- make_C_tag (TRUE); /* an Objective C category */
+ make_C_tag (true); /* an Objective C category */
objdef = oignore;
}
if (--parlev == 0)
|| typdef == ttypeseen))
{
typdef = tignore;
- make_C_tag (FALSE); /* a typedef */
+ make_C_tag (false); /* a typedef */
}
}
else if (parlev < 0) /* can happen due to ill-conceived #if's. */
switch (fvdef)
{
case flistseen:
- make_C_tag (TRUE); /* a function */
+ make_C_tag (true); /* a function */
/* FALLTHRU */
case fignore:
fvdef = fvnone;
switch (objdef)
{
case otagseen:
- make_C_tag (TRUE); /* an Objective C class */
+ make_C_tag (true); /* an Objective C class */
objdef = oignore;
break;
case omethodtag:
case omethodparm:
- make_C_tag (TRUE); /* an Objective C method */
+ make_C_tag (true); /* an Objective C method */
objdef = oinbody;
break;
default:
case scolonseen: /* a class */
pushclass_above (bracelev,token.line+token.offset, token.length);
structdef = snone;
- make_C_tag (FALSE); /* a struct or enum */
+ make_C_tag (false); /* a struct or enum */
break;
}
bracelev += 1;
if (fvdef == fstartlist)
{
fvdef = fvnone; /* avoid tagging `foo' in `foo (*bar()) ()' */
- token.valid = FALSE;
+ token.valid = false;
}
break;
case '}':
if (!ignoreindent && lp == newlb.buffer + 1)
{
if (bracelev != 0)
- token.valid = FALSE; /* unexpected value, token unreliable */
+ token.valid = false; /* unexpected value, token unreliable */
bracelev = 0; /* reset brace level if first column */
parlev = 0; /* also reset paren level, just in case... */
}
else if (bracelev < 0)
{
- token.valid = FALSE; /* something gone amiss, token unreliable */
+ token.valid = false; /* something gone amiss, token unreliable */
bracelev = 0;
}
if (bracelev == 0 && fvdef == vignore)
case fvnameseen:
if ((members && bracelev == 1)
|| (globals && bracelev == 0 && (!fvextern || declarations)))
- make_C_tag (FALSE); /* a variable */
+ make_C_tag (false); /* a variable */
/* FALLTHRU */
default:
fvdef = vignore;
case '\0':
if (objdef == otagseen)
{
- make_C_tag (TRUE); /* an Objective C class */
+ make_C_tag (true); /* an Objective C class */
objdef = oignore;
}
/* If a macro spans multiple lines don't reset its state. */
&& /* instructions at start of loop */ \
(readline (&line_buffer, file_pointer), \
char_pointer = line_buffer.buffer, \
- TRUE); \
+ true); \
)
#define LOOKING_AT(cp, kw) /* kw is the keyword, a literal string */ \
- ((assert ("" kw), TRUE) /* syntax error if not a literal string */ \
+ ((assert ("" kw), true) /* syntax error if not a literal string */ \
&& strneq ((cp), kw, sizeof (kw)-1) /* cp points at kw */ \
&& notinname ((cp)[sizeof (kw)-1]) /* end of kw */ \
&& ((cp) = skip_spaces ((cp)+sizeof (kw)-1))) /* skip spaces */
/* Similar to LOOKING_AT but does not use notinname, does not skip */
#define LOOKING_AT_NOCASE(cp, kw) /* the keyword is a literal string */ \
- ((assert ("" kw), TRUE) /* syntax error if not a literal string */ \
+ ((assert ("" kw), true) /* syntax error if not a literal string */ \
&& strncaseeq ((cp), kw, sizeof (kw)-1) /* cp points at kw */ \
&& ((cp) += sizeof (kw)-1)) /* skip spaces */
return;
for (cp = dbp + 1; *cp != '\0' && intoken (*cp); cp++)
continue;
- make_tag (dbp, cp-dbp, TRUE,
+ make_tag (dbp, cp-dbp, true,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
{
dbp = skip_spaces (dbp);
if (*dbp == '\0') /* assume un-named */
- make_tag ("blockdata", 9, TRUE,
+ make_tag ("blockdata", 9, true,
lb.buffer, dbp - lb.buffer, lineno, linecharno);
else
F_getit (inf); /* look for name */
*cp = '\0';
name = concat (dbp, name_qualifier, "");
*cp = c;
- make_tag (name, strlen (name), TRUE,
+ make_tag (name, strlen (name), true,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
free (name);
if (c == '"')
static void
Ada_funcs (FILE *inf)
{
- bool inquote = FALSE;
- bool skip_till_semicolumn = FALSE;
+ bool inquote = false;
+ bool skip_till_semicolumn = false;
LOOP_ON_INPUT_LINES (inf, lb, dbp)
{
dbp = etags_strchr (dbp + !inquote, '"');
if (dbp != NULL)
{
- inquote = FALSE;
+ inquote = false;
dbp += 1;
continue; /* advance char */
}
else
{
- inquote = TRUE;
+ inquote = true;
break; /* advance line */
}
}
if (skip_till_semicolumn)
{
if (*dbp == ';')
- skip_till_semicolumn = FALSE;
+ skip_till_semicolumn = false;
dbp++;
continue; /* advance char */
}
{
/* when tagging types, avoid tagging use type Pack.Typename;
for this, we will skip everything till a ; */
- skip_till_semicolumn = TRUE;
+ skip_till_semicolumn = true;
continue; /* advance char */
}
cp++;
if (*cp == ':' || iswhite (*cp))
/* Found end of label, so copy it and add it to the table. */
- make_tag (lb.buffer, cp - lb.buffer, TRUE,
+ make_tag (lb.buffer, cp - lb.buffer, true,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
}
* Perl variable names: /^(my|local).../
* Original code by Bart Robinson <lomew@cs.utah.edu> (1995)
* Additions by Michael Ernst <mernst@alum.mit.edu> (1997)
- * Ideas by Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> (2001)
+ * Ideas by Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> (2001)
*/
static void
Perl_functions (FILE *inf)
if ((pos = etags_strchr (sp, ':')) != NULL
&& pos < cp && pos[1] == ':')
/* The name is already qualified. */
- make_tag (sp, cp - sp, TRUE,
+ make_tag (sp, cp - sp, true,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
else
/* Qualify it. */
*cp = '\0';
name = concat (package, "::", sp);
*cp = savechar;
- make_tag (name, strlen (name), TRUE,
+ make_tag (name, strlen (name), true,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
free (name);
}
else
continue;
- make_tag (varstart, cp - varstart, FALSE,
+ make_tag (varstart, cp - varstart, false,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
}
char *name = cp;
while (!notinname (*cp) && *cp != ':')
cp++;
- make_tag (name, cp - name, TRUE,
+ make_tag (name, cp - name, true,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
}
static void
PHP_functions (FILE *inf)
{
- register char *cp, *name;
- bool search_identifier = FALSE;
+ char *cp, *name;
+ bool search_identifier = false;
LOOP_ON_INPUT_LINES (inf, lb, cp)
{
{
while (!notinname (*cp))
cp++;
- make_tag (name, cp - name, TRUE,
+ make_tag (name, cp - name, true,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
- search_identifier = FALSE;
+ search_identifier = false;
}
else if (LOOKING_AT (cp, "function"))
{
name = cp;
while (!notinname (*cp))
cp++;
- make_tag (name, cp - name, TRUE,
+ make_tag (name, cp - name, true,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
else
- search_identifier = TRUE;
+ search_identifier = true;
}
else if (LOOKING_AT (cp, "class"))
{
name = cp;
while (*cp != '\0' && !iswhite (*cp))
cp++;
- make_tag (name, cp - name, FALSE,
+ make_tag (name, cp - name, false,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
else
- search_identifier = TRUE;
+ search_identifier = true;
}
else if (strneq (cp, "define", 6)
&& (cp = skip_spaces (cp+6))
name = cp;
while (*cp != quote && *cp != '\0')
cp++;
- make_tag (name, cp - name, FALSE,
+ make_tag (name, cp - name, false,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
else if (members
name = cp;
while (!notinname (*cp))
cp++;
- make_tag (name, cp - name, FALSE,
+ make_tag (name, cp - name, false,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
}
for (ep = bp; ISALNUM (*ep) || *ep == '-'; ep++)
continue;
if (*ep++ == '.')
- make_tag (bp, ep - bp, TRUE,
+ make_tag (bp, ep - bp, true,
lb.buffer, ep - lb.buffer + 1, lineno, linecharno);
}
}
while (--bp > namestart)
if (!notinname (*bp))
break;
- make_tag (namestart, bp - namestart + 1, TRUE,
+ make_tag (namestart, bp - namestart + 1, true,
lb.buffer, bp - lb.buffer + 2, lineno, linecharno);
}
}
int save_lineno, namelen, taglen;
char c, *name;
- bool /* each of these flags is TRUE if: */
+ bool /* each of these flags is true if: */
incomment, /* point is inside a comment */
inquote, /* point is inside '..' string */
get_tagname, /* point is after PROCEDURE/FUNCTION
*dbp = '\0';
linebuffer_init (&tline);
- incomment = inquote = FALSE;
- found_tag = FALSE; /* have a proc name; check if extern */
- get_tagname = FALSE; /* found "procedure" keyword */
- inparms = FALSE; /* found '(' after "proc" */
- verify_tag = FALSE; /* check if "extern" is ahead */
+ incomment = inquote = false;
+ found_tag = false; /* have a proc name; check if extern */
+ get_tagname = false; /* found "procedure" keyword */
+ inparms = false; /* found '(' after "proc" */
+ verify_tag = false; /* check if "extern" is ahead */
while (!feof (inf)) /* long main loop to get next char */
if (incomment)
{
if (c == '}') /* within { } comments */
- incomment = FALSE;
+ incomment = false;
else if (c == '*' && *dbp == ')') /* within (* *) comments */
{
dbp++;
- incomment = FALSE;
+ incomment = false;
}
continue;
}
else if (inquote)
{
if (c == '\'')
- inquote = FALSE;
+ inquote = false;
continue;
}
else
switch (c)
{
case '\'':
- inquote = TRUE; /* found first quote */
+ inquote = true; /* found first quote */
continue;
case '{': /* found open { comment */
- incomment = TRUE;
+ incomment = true;
continue;
case '(':
if (*dbp == '*') /* found open (* comment */
{
- incomment = TRUE;
+ incomment = true;
dbp++;
}
else if (found_tag) /* found '(' after tag, i.e., parm-list */
- inparms = TRUE;
+ inparms = true;
continue;
case ')': /* end of parms list */
if (inparms)
- inparms = FALSE;
+ inparms = false;
continue;
case ';':
if (found_tag && !inparms) /* end of proc or fn stmt */
{
- verify_tag = TRUE;
+ verify_tag = true;
break;
}
continue;
{
if (nocase_tail ("extern")) /* superfluous, really! */
{
- found_tag = FALSE;
- verify_tag = FALSE;
+ found_tag = false;
+ verify_tag = false;
}
}
else if (lowcase (*dbp) == 'f')
{
if (nocase_tail ("forward")) /* check for forward reference */
{
- found_tag = FALSE;
- verify_tag = FALSE;
+ found_tag = false;
+ verify_tag = false;
}
}
if (found_tag && verify_tag) /* not external proc, so make tag */
{
- found_tag = FALSE;
- verify_tag = FALSE;
- make_tag (name, namelen, TRUE,
+ found_tag = false;
+ verify_tag = false;
+ make_tag (name, namelen, true,
tline.buffer, taglen, save_lineno, save_lcno);
continue;
}
taglen = cp - lb.buffer + 1;
dbp = cp; /* set dbp to e-o-token */
- get_tagname = FALSE;
- found_tag = TRUE;
+ get_tagname = false;
+ found_tag = true;
continue;
/* And proceed to check for "extern". */
{
case 'p':
if (nocase_tail ("rocedure")) /* c = 'p', dbp has advanced */
- get_tagname = TRUE;
+ get_tagname = true;
continue;
case 'f':
if (nocase_tail ("unction"))
- get_tagname = TRUE;
+ get_tagname = true;
continue;
}
}
*ep != '\0' && *ep != ' ' && *ep != '{';
ep++)
continue;
- make_tag (bp, ep - bp, TRUE,
+ make_tag (bp, ep - bp, true,
lb.buffer, ep - lb.buffer + 1, lineno, linecharno);
}
else if (LOOKING_AT (bp, "defineps"))
for (key = TEX_toktab; key->buffer != NULL; key++)
if (strneq (cp, key->buffer, key->len))
{
- register char *p;
+ char *p;
int namelen, linelen;
- bool opgrp = FALSE;
+ bool opgrp = false;
cp = skip_spaces (cp + key->len);
if (*cp == TEX_opgrp)
{
- opgrp = TRUE;
+ opgrp = true;
cp++;
}
for (p = cp;
p++;
linelen = p - lb.buffer + 1;
}
- make_tag (cp, namelen, TRUE,
+ make_tag (cp, namelen, true,
lb.buffer, linelen, lineno, linecharno);
goto tex_next_line; /* We only tag a line once */
}
start = cp;
while (*cp != '\0' && *cp != ',')
cp++;
- make_tag (start, cp - start, TRUE,
+ make_tag (start, cp - start, true,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
}
* Contents of <title>, <h1>, <h2>, <h3> are tags.
* Contents of <a name=xxx> are tags with name xxx.
*
- * Francesco Potortì, 2002.
+ * Francesco Potortì, 2002.
*/
static void
HTML_labels (FILE *inf)
{
- bool getnext = FALSE; /* next text outside of HTML tags is a tag */
- bool skiptag = FALSE; /* skip to the end of the current HTML tag */
- bool intag = FALSE; /* inside an html tag, looking for ID= */
- bool inanchor = FALSE; /* when INTAG, is an anchor, look for NAME= */
+ bool getnext = false; /* next text outside of HTML tags is a tag */
+ bool skiptag = false; /* skip to the end of the current HTML tag */
+ bool intag = false; /* inside an html tag, looking for ID= */
+ bool inanchor = false; /* when INTAG, is an anchor, look for NAME= */
char *end;
if (*dbp == '>')
{
dbp += 1;
- skiptag = FALSE;
+ skiptag = false;
continue; /* look on the same line */
}
break; /* go to next line */
if (*dbp == '>')
{
dbp += 1;
- intag = FALSE;
+ intag = false;
continue; /* look on the same line */
}
if ((inanchor && LOOKING_AT_NOCASE (dbp, "name="))
token_name.buffer[end - dbp] = '\0';
dbp = end;
- intag = FALSE; /* we found what we looked for */
- skiptag = TRUE; /* skip to the end of the tag */
- getnext = TRUE; /* then grab the text */
+ intag = false; /* we found what we looked for */
+ skiptag = true; /* skip to the end of the tag */
+ getnext = true; /* then grab the text */
continue; /* look on the same line */
}
dbp += 1;
break; /* go to next line */
if (*dbp == '<')
{
- intag = TRUE;
+ intag = true;
inanchor = (lowcase (dbp[1]) == 'a' && !intoken (dbp[2]));
continue; /* look on the same line */
}
for (end = dbp + 1; *end != '\0' && *end != '<'; end++)
continue;
- make_tag (token_name.buffer, token_name.len, TRUE,
+ make_tag (token_name.buffer, token_name.len, true,
dbp, end - dbp, lineno, linecharno);
linebuffer_setlen (&token_name, 0); /* no name in buffer */
- getnext = FALSE;
+ getnext = false;
break; /* go to next line */
}
dbp++;
if (*dbp == '\0')
break; /* go to next line */
- intag = TRUE;
+ intag = true;
if (lowcase (dbp[1]) == 'a' && !intoken (dbp[2]))
{
- inanchor = TRUE;
+ inanchor = true;
continue; /* look on the same line */
}
else if (LOOKING_AT_NOCASE (dbp, "<title>")
|| LOOKING_AT_NOCASE (dbp, "<h2>")
|| LOOKING_AT_NOCASE (dbp, "<h3>"))
{
- intag = FALSE;
- getnext = TRUE;
+ intag = false;
+ getnext = true;
continue; /* look on the same line */
}
dbp += 1;
|| len != strlen (last)
|| !strneq (s, last, len)))
{
- make_tag (s, len, TRUE, s, pos, lineno, linecharno);
+ make_tag (s, len, true, s, pos, lineno, linecharno);
return len;
}
else
|| len != (int)strlen (last)
|| !strneq (s, last, len)))
{
- make_tag (s, len, TRUE, s, pos, lineno, linecharno);
+ make_tag (s, len, true, s, pos, lineno, linecharno);
return len;
}
{
int len = erlang_atom (skip_spaces (cp));
if (len > 0)
- make_tag (cp, len, TRUE, s, cp + len - s, lineno, linecharno);
+ make_tag (cp, len, true, s, cp + len - s, lineno, linecharno);
}
return;
}
{
char sep = name[0];
char *copyto = name;
- bool quoted = FALSE;
+ bool quoted = false;
for (++name; *name != '\0'; ++name)
{
}
break;
}
- quoted = FALSE;
+ quoted = false;
}
else if (*name == '\\')
- quoted = TRUE;
+ quoted = true;
else if (*name == sep)
break;
else
/* regexfile is a file containing regexps, one per line. */
regexfp = fopen (regexfile, "r");
if (regexfp == NULL)
- {
- pfatal (regexfile);
- return;
- }
+ pfatal (regexfile);
linebuffer_init (®exbuf);
while (readline_internal (®exbuf, regexfp) > 0)
analyse_regex (regexbuf.buffer);
struct re_pattern_buffer *patbuf;
regexp *rp;
bool
- force_explicit_name = TRUE, /* do not use implicit tag names */
- ignore_case = FALSE, /* case is significant */
- multi_line = FALSE, /* matches are done one line at a time */
- single_line = FALSE; /* dot does not match newline */
+ force_explicit_name = true, /* do not use implicit tag names */
+ ignore_case = false, /* case is significant */
+ multi_line = false, /* matches are done one line at a time */
+ single_line = false; /* dot does not match newline */
if (strlen (regexp_pattern) < 3)
case 'N':
if (modifiers == name)
error ("forcing explicit tag name but no name, ignoring");
- force_explicit_name = TRUE;
+ force_explicit_name = true;
break;
case 'i':
- ignore_case = TRUE;
+ ignore_case = true;
break;
case 's':
- single_line = TRUE;
+ single_line = true;
/* FALLTHRU */
case 'm':
- multi_line = TRUE;
- need_filebuf = TRUE;
+ multi_line = true;
+ need_filebuf = true;
break;
default:
error ("invalid regexp modifier `%c', ignoring", modifiers[0]);
p_head->lang = lang;
p_head->pat = patbuf;
p_head->name = savestr (name);
- p_head->error_signaled = FALSE;
+ p_head->error_signaled = false;
p_head->force_explicit_name = force_explicit_name;
p_head->ignore_case = ignore_case;
p_head->multi_line = multi_line;
{
error ("regexp stack overflow while matching \"%s\"",
rp->pattern);
- rp->error_signaled = TRUE;
+ rp->error_signaled = true;
}
break;
case -1:
{
error ("regexp matches the empty string: \"%s\"",
rp->pattern);
- rp->error_signaled = TRUE;
+ rp->error_signaled = true;
}
match = -3; /* exit from while loop */
break;
name = substitute (buffer, rp->name, &rp->regs);
if (rp->force_explicit_name)
/* Force explicit tag name, if a name is there. */
- pfnote (name, TRUE, buffer + linecharno,
+ pfnote (name, true, buffer + linecharno,
charno - linecharno + 1, lineno, linecharno);
else
- make_tag (name, strlen (name), TRUE, buffer + linecharno,
+ make_tag (name, strlen (name), true, buffer + linecharno,
charno - linecharno + 1, lineno, linecharno);
break;
}
if (*cp == '\0' && !intoken (dbp[len]))
{
dbp += len;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
static void
/* Go till you get to white space or a syntactic break */
for (cp = bp + 1; !notinname (*cp); cp++)
continue;
- make_tag (bp, cp - bp, TRUE,
+ make_tag (bp, cp - bp, true,
lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
}
char *taggedfname; /* name of original file as given */
char *name; /* temp var */
- discard_until_line_directive = FALSE; /* found it */
+ discard_until_line_directive = false; /* found it */
name = lbp->buffer + start;
*endp = '\0';
canonicalize_filename (name);
for (fdp = fdhead; fdp != NULL; fdp = fdp->next)
if (streq (fdp->infabsname, taggedabsname))
{
- discard_until_line_directive = TRUE;
+ discard_until_line_directive = true;
free (taggedfname);
break;
}
fdhead->infabsname = savestr (curfdp->infabsname);
fdhead->infabsdir = savestr (curfdp->infabsdir);
fdhead->taggedfname = taggedfname;
- fdhead->usecharno = FALSE;
+ fdhead->usecharno = false;
fdhead->prop = NULL;
- fdhead->written = FALSE;
+ fdhead->written = false;
curfdp = fdhead;
}
}
return;
}
/* End of file. */
- discard_until_line_directive = FALSE;
+ discard_until_line_directive = false;
return;
}
} /* if #line directives should be considered */
{
error ("regexp stack overflow while matching \"%s\"",
rp->pattern);
- rp->error_signaled = TRUE;
+ rp->error_signaled = true;
}
break;
case -1:
if (!rp->error_signaled)
{
error ("regexp matches the empty string: \"%s\"", rp->pattern);
- rp->error_signaled = TRUE;
+ rp->error_signaled = true;
}
break;
default:
name = substitute (lbp->buffer, rp->name, &rp->regs);
if (rp->force_explicit_name)
/* Force explicit tag name, if a name is there. */
- pfnote (name, TRUE, lbp->buffer, match, lineno, linecharno);
+ pfnote (name, true, lbp->buffer, match, lineno, linecharno);
else
- make_tag (name, strlen (name), TRUE,
+ make_tag (name, strlen (name), true,
lbp->buffer, match, lineno, linecharno);
break;
}
static char *
savenstr (const char *cp, int len)
{
- register char *dp;
-
- dp = xnew (len + 1, char);
- memcpy (dp, cp, len);
+ char *dp = xnew (len + 1, char);
dp[len] = '\0';
- return dp;
+ return memcpy (dp, cp, len);
}
/*
strcpy (result, s1);
strcpy (result + len1, s2);
strcpy (result + len1 + len2, s3);
- result[len1 + len2 + len3] = '\0';
return result;
}