* Francesco Potorti` (F.Potorti@cnuce.cnr.it) is the current maintainer.
*/
-char pot_etags_version[] = "@(#) pot revision number is 11.77";
+char pot_etags_version[] = "@(#) pot revision number is 11.80";
#define TRUE 1
#define FALSE 0
"mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS",
tagfile, argbuffer[i].what, tagfile);
if (system (cmd) != GOOD)
- fatal ("failed to execute shell command", NULL);
+ fatal ("failed to execute shell command", (char *)NULL);
}
append_to_tagfile = TRUE;
}
{
/* Etags Mode */
if (last_node == NULL)
- fatal ("internal error in add_node", NULL);
+ fatal ("internal error in add_node", (char *)NULL);
last_node->right = node;
last_node = node;
}
else
{
if (node->name == NULL)
- error ("internal error: NULL name in ctags mode.", NULL);
+ error ("internal error: NULL name in ctags mode.", (char *)NULL);
if (cxref_style)
{
case dignorerest:
return FALSE;
default:
- error ("internal error: definedef value.", NULL);
+ error ("internal error: definedef value.", (char *)NULL);
}
/*
definedef = dnone; \
} while (0)
-/* This macro should never be called when tok.valid is FALSE, but
- we must protect about both invalid input and internal errors. */
-#define make_C_tag(isfun) do \
-if (tok.valid) { \
- char *name = NULL; \
- if (CTAGS || tok.named) \
- name = savestr (token_name.buffer); \
- pfnote (name, isfun, tok.buffer, tok.linelen, tok.lineno, tok.linepos); \
- tok.valid = FALSE; \
-} /* else if (DEBUG) abort (); */ while (0)
+
+void
+make_C_tag (isfun, tokp)
+ logical isfun;
+ TOKEN *tokp;
+{
+ char *name = NULL;
+
+ /* This function should never be called when tok.valid is FALSE, but
+ we must protect against invalid input or internal errors. */
+ if (tokp->valid)
+ {
+ if (CTAGS || tokp->named)
+ name = savestr (token_name.buffer);
+ pfnote (name, isfun,
+ tokp->buffer, tokp->linelen, tokp->lineno, tokp->linepos);
+ tokp->valid = FALSE;
+ }
+ else if (DEBUG)
+ abort ();
+}
+
void
C_entries (c_ext, inf)
switch_line_buffers ();
}
else
- make_C_tag (is_func);
+ make_C_tag (is_func, &tok);
}
midtoken = FALSE;
}
funcdef = finlist;
continue;
case flistseen:
- make_C_tag (TRUE);
+ make_C_tag (TRUE, &tok);
funcdef = fignore;
break;
case ftagseen:
{
case otagseen:
objdef = oignore;
- make_C_tag (TRUE);
+ make_C_tag (TRUE, &tok);
break;
case omethodtag:
case omethodparm:
case ftagseen:
if (yacc_rules)
{
- make_C_tag (FALSE);
+ make_C_tag (FALSE, &tok);
funcdef = fignore;
}
break;
switch (typdef)
{
case tend:
- make_C_tag (FALSE);
+ make_C_tag (FALSE, &tok);
/* FALLTHRU */
default:
typdef = tnone;
{
case omethodtag:
case omethodparm:
- make_C_tag (TRUE);
+ make_C_tag (TRUE, &tok);
objdef = oinbody;
break;
}
if (cblev == 0 && typdef == tend)
{
typdef = tignore;
- make_C_tag (FALSE);
+ make_C_tag (FALSE, &tok);
break;
}
if (funcdef != finlist && funcdef != fignore)
/* Make sure that the next char is not a '*'.
This handles constructs like:
typedef void OperatorFun (int fun); */
- if (*lp != '*')
+ if (tok.valid && *lp != '*')
{
typdef = tignore;
- make_C_tag (FALSE);
+ make_C_tag (FALSE, &tok);
}
break;
} /* switch (typdef) */
break;
if (objdef == ocatseen && parlev == 1)
{
- make_C_tag (TRUE);
+ make_C_tag (TRUE, &tok);
objdef = oignore;
}
if (--parlev == 0)
if (cblev == 0 && typdef == tend)
{
typdef = tignore;
- make_C_tag (FALSE);
+ make_C_tag (FALSE, &tok);
}
}
else if (parlev < 0) /* can happen due to ill-conceived #if's. */
case stagseen:
case scolonseen: /* named struct */
structdef = sinbody;
- make_C_tag (FALSE);
+ make_C_tag (FALSE, &tok);
break;
}
switch (funcdef)
{
case flistseen:
- make_C_tag (TRUE);
+ make_C_tag (TRUE, &tok);
/* FALLTHRU */
case fignore:
funcdef = fnone;
switch (objdef)
{
case otagseen:
- make_C_tag (TRUE);
+ make_C_tag (TRUE, &tok);
objdef = oignore;
break;
case omethodtag:
case omethodparm:
- make_C_tag (TRUE);
+ make_C_tag (TRUE, &tok);
objdef = oinbody;
break;
default:
case '\0':
if (objdef == otagseen)
{
- make_C_tag (TRUE);
+ make_C_tag (TRUE, &tok);
objdef = oignore;
}
/* If a macro spans multiple lines don't reset its state. */
i = TEX_Token (lasthit);
if (0 <= i)
{
- pfnote (NULL, TRUE,
+ pfnote ((char *)NULL, TRUE,
lb.buffer, strlen (lb.buffer), lineno, linecharno);
#if TeX_named_tokens
TEX_getit (lasthit, TEX_toktab[i].len);
else if (len = prolog_pred (dbp, last))
{
/* Predicate. Store the function name so that we only
- * generates a tag for the first clause. */
+ generate a tag for the first clause. */
if (last == NULL)
last = xnew(len + 1, char);
else if (len + 1 > allocated)
if (regexp_pattern[0] == '\0')
{
- error ("missing regexp", NULL);
+ error ("missing regexp", (char *)NULL);
return;
}
if (regexp_pattern[strlen(regexp_pattern)-1] != regexp_pattern[0])
name = scan_separators (regexp_pattern);
if (regexp_pattern[0] == '\0')
{
- error ("null regexp", NULL);
+ error ("null regexp", (char *)NULL);
return;
}
(void) scan_separators (name);
else
{
/* Make an unnamed tag. */
- pfnote (NULL, TRUE,
+ pfnote ((char *)NULL, TRUE,
linebuffer->buffer, match, lineno, linecharno);
}
break;
{
long *result = (long *) malloc (size);
if (result == NULL)
- fatal ("virtual memory exhausted", NULL);
+ fatal ("virtual memory exhausted", (char *)NULL);
return result;
}
{
long *result = (long *) realloc (ptr, size);
if (result == NULL)
- fatal ("virtual memory exhausted", NULL);
+ fatal ("virtual memory exhausted", (char *)NULL);
return result;
}