static char *skip_name (char *);
static char *savenstr (const char *, int);
static char *savestr (const char *);
-static char *etags_strchr (const char *, int);
-static char *etags_strrchr (const char *, int);
static char *etags_getcwd (void);
static char *relative_filename (char *, char *);
static char *absolute_filename (char *, char *);
/* File has been processed by canonicalize_filename,
so we don't need to consider backslashes on DOS_NT. */
- slash = etags_strrchr (file, '/');
- suffix = etags_strrchr (file, '.');
+ slash = strrchr (file, '/');
+ suffix = strrchr (file, '.');
if (suffix == NULL || suffix < slash)
return NULL;
if (extptr != NULL)
return lang;
/* If not found, try suffix after last dot. */
- suffix = etags_strrchr (file, '.');
+ suffix = strrchr (file, '.');
if (suffix == NULL)
return NULL;
suffix += 1;
/* Set lp to point at the first char after the last slash in the
line or, if no slashes, at the first nonblank. Then set cp to
the first successive blank and terminate the string. */
- lp = etags_strrchr (lb.buffer+2, '/');
+ lp = strrchr (lb.buffer+2, '/');
if (lp != NULL)
lp += 1;
else
/* If ctags mode, change name "main" to M<thisfilename>. */
if (CTAGS && !cxref_style && streq (name, "main"))
{
- register char *fp = etags_strrchr (curfdp->taggedfname, '/');
+ char *fp = strrchr (curfdp->taggedfname, '/');
np->name = concat ("M", fp == NULL ? curfdp->taggedfname : fp + 1, "");
- fp = etags_strrchr (np->name, '.');
+ fp = strrchr (np->name, '.');
if (fp != NULL && fp[1] != '\0' && fp[2] == '\0')
fp[0] = '\0';
}
/* Skip a string i.e. "abcd". */
if (inquote || (*dbp == '"'))
{
- dbp = etags_strchr (dbp + !inquote, '"');
+ dbp = strchr (dbp + !inquote, '"');
if (dbp != NULL)
{
inquote = false;
cp++;
if (cp == sp)
continue; /* nothing found */
- if ((pos = etags_strchr (sp, ':')) != NULL
+ if ((pos = strchr (sp, ':')) != NULL
&& pos < cp && pos[1] == ':')
/* The name is already qualified. */
make_tag (sp, cp - sp, true,
/* Allocate a token table */
for (len = 1, p = env; p;)
- if ((p = etags_strchr (p, ':')) && *++p != '\0')
+ if ((p = strchr (p, ':')) && *++p != '\0')
len++;
TEX_toktab = xnew (len, linebuffer);
/* zero-length strings (leading ':', "::" and trailing ':') */
for (i = 0; *env != '\0';)
{
- p = etags_strchr (env, ':');
+ p = strchr (env, ':');
if (!p) /* End of environment string. */
p = env + strlen (env);
if (p - env > 0)
/* Pass 1: figure out how much to allocate by finding all \N strings. */
if (out[size - 1] == '\\')
fatal ("pattern error in \"%s\"", out);
- for (t = etags_strchr (out, '\\');
+ for (t = strchr (out, '\\');
t != NULL;
- t = etags_strchr (t + 2, '\\'))
+ t = strchr (t + 2, '\\'))
if (ISDIGIT (t[1]))
{
dig = t[1] - '0';
{
char *endp = lbp->buffer + start;
- while ((endp = etags_strchr (endp, '"')) != NULL
+ while ((endp = strchr (endp, '"')) != NULL
&& endp[-1] == '\\')
endp++;
if (endp != NULL)
return memcpy (dp, cp, len);
}
-/*
- * Return the ptr in sp at which the character c last
- * appears; NULL if not found
- *
- * Identical to POSIX strrchr, included for portability.
- */
-static char *
-etags_strrchr (register const char *sp, register int c)
-{
- register const char *r;
-
- r = NULL;
- do
- {
- if (*sp == c)
- r = sp;
- } while (*sp++);
- return (char *)r;
-}
-
-/*
- * Return the ptr in sp at which the character c first
- * appears; NULL if not found
- *
- * Identical to POSIX strchr, included for portability.
- */
-static char *
-etags_strchr (register const char *sp, register int c)
-{
- do
- {
- if (*sp == c)
- return (char *)sp;
- } while (*sp++);
- return NULL;
-}
-
/* Skip spaces (end of string is not space), return new pointer. */
static char *
skip_spaces (char *cp)
/* Build a sequence of "../" strings for the resulting relative file name. */
i = 0;
- while ((dp = etags_strchr (dp + 1, '/')) != NULL)
+ while ((dp = strchr (dp + 1, '/')) != NULL)
i += 1;
res = xnew (3*i + strlen (fp + 1) + 1, char);
res[0] = '\0';
res = concat (dir, file, "");
/* Delete the "/dirname/.." and "/." substrings. */
- slashp = etags_strchr (res, '/');
+ slashp = strchr (res, '/');
while (slashp != NULL && slashp[0] != '\0')
{
if (slashp[1] == '.')
}
}
- slashp = etags_strchr (slashp + 1, '/');
+ slashp = strchr (slashp + 1, '/');
}
if (res[0] == '\0') /* just a safety net: should never happen */
char *slashp, *res;
char save;
- slashp = etags_strrchr (file, '/');
+ slashp = strrchr (file, '/');
if (slashp == NULL)
return savestr (dir);
save = slashp[1];