From 408cb71795ab3e8eabdf5b24917e7fb3e7a97d49 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 22 Mar 2005 13:54:29 -0300 Subject: avoid name conflict with some spurious included header files --- lstrlib.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lstrlib.c') diff --git a/lstrlib.c b/lstrlib.c index ebe27d35..1a2e6c29 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.109 2004/12/01 15:46:06 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.110 2005/03/08 20:10:05 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -176,7 +176,7 @@ typedef struct MatchState { } MatchState; -#define ESC '%' +#define L_ESC '%' #define SPECIALS "^$*+?.([%-" @@ -198,7 +198,7 @@ static int capture_to_close (MatchState *ms) { static const char *classend (MatchState *ms, const char *p) { switch (*p++) { - case ESC: { + case L_ESC: { if (*p == '\0') luaL_error(ms->L, "malformed pattern (ends with `%%')"); return p+1; @@ -208,7 +208,7 @@ static const char *classend (MatchState *ms, const char *p) { do { /* look for a `]' */ if (*p == '\0') luaL_error(ms->L, "malformed pattern (missing `]')"); - if (*(p++) == ESC && *p != '\0') + if (*(p++) == L_ESC && *p != '\0') p++; /* skip escapes (e.g. `%]') */ } while (*p != ']'); return p+1; @@ -246,7 +246,7 @@ static int matchbracketclass (int c, const char *p, const char *ec) { p++; /* skip the `^' */ } while (++p < ec) { - if (*p == ESC) { + if (*p == L_ESC) { p++; if (match_class(c, uchar(*p))) return sig; @@ -265,7 +265,7 @@ static int matchbracketclass (int c, const char *p, const char *ec) { static int singlematch (int c, const char *p, const char *ep) { switch (*p) { case '.': return 1; /* matches any char */ - case ESC: return match_class(c, uchar(*(p+1))); + case L_ESC: return match_class(c, uchar(*(p+1))); case '[': return matchbracketclass(c, p, ep-1); default: return (uchar(*p) == c); } @@ -371,7 +371,7 @@ static const char *match (MatchState *ms, const char *s, const char *p) { case ')': { /* end capture */ return end_capture(ms, s, p+1); } - case ESC: { + case L_ESC: { switch (*(p+1)) { case 'b': { /* balanced string? */ s = matchbalance(ms, s, p+2); @@ -567,7 +567,7 @@ static void add_s (MatchState *ms, luaL_Buffer *b, size_t l = lua_strlen(L, 3); size_t i; for (i=0; i MAX_FORMAT) /* +2 to include `%' and the specifier */ luaL_error(L, "invalid format (too long)"); - form[0] = ESC; + form[0] = L_ESC; strncpy(form+1, strfrmt, p-strfrmt+1); form[p-strfrmt+2] = 0; return p; @@ -697,9 +697,9 @@ static int str_format (lua_State *L) { luaL_Buffer b; luaL_buffinit(L, &b); while (strfrmt < strfrmt_end) { - if (*strfrmt != ESC) + if (*strfrmt != L_ESC) luaL_putchar(&b, *strfrmt++); - else if (*++strfrmt == ESC) + else if (*++strfrmt == L_ESC) luaL_putchar(&b, *strfrmt++); /* %% */ else { /* format item */ char form[MAX_FORMAT]; /* to store the format (`%...') */ -- cgit v1.2.3-55-g6feb