diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-22 09:44:20 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-22 09:44:20 -0200 |
commit | 6b12b8253247079941e6303e9bb47aaeec03331b (patch) | |
tree | 913b96240cbb290f758e6a4de4213a53132ab99c | |
parent | d7a0179cd60657079d522c17da1e5aa5cc20532d (diff) | |
download | lua-6b12b8253247079941e6303e9bb47aaeec03331b.tar.gz lua-6b12b8253247079941e6303e9bb47aaeec03331b.tar.bz2 lua-6b12b8253247079941e6303e9bb47aaeec03331b.zip |
added 'l_' prefix for names that can be redefined externally
-rw-r--r-- | lauxlib.c | 10 | ||||
-rw-r--r-- | liolib.c | 8 | ||||
-rw-r--r-- | llex.c | 8 |
3 files changed, 13 insertions, 13 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.268 2014/09/22 06:42:15 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.269 2014/10/17 16:28:21 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -229,7 +229,7 @@ LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) { | |||
229 | } | 229 | } |
230 | 230 | ||
231 | 231 | ||
232 | #if !defined(inspectstat) /* { */ | 232 | #if !defined(l_inspectstat) /* { */ |
233 | 233 | ||
234 | #if defined(LUA_USE_POSIX) | 234 | #if defined(LUA_USE_POSIX) |
235 | 235 | ||
@@ -238,13 +238,13 @@ LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) { | |||
238 | /* | 238 | /* |
239 | ** use appropriate macros to interpret 'pclose' return status | 239 | ** use appropriate macros to interpret 'pclose' return status |
240 | */ | 240 | */ |
241 | #define inspectstat(stat,what) \ | 241 | #define l_inspectstat(stat,what) \ |
242 | if (WIFEXITED(stat)) { stat = WEXITSTATUS(stat); } \ | 242 | if (WIFEXITED(stat)) { stat = WEXITSTATUS(stat); } \ |
243 | else if (WIFSIGNALED(stat)) { stat = WTERMSIG(stat); what = "signal"; } | 243 | else if (WIFSIGNALED(stat)) { stat = WTERMSIG(stat); what = "signal"; } |
244 | 244 | ||
245 | #else | 245 | #else |
246 | 246 | ||
247 | #define inspectstat(stat,what) /* no op */ | 247 | #define l_inspectstat(stat,what) /* no op */ |
248 | 248 | ||
249 | #endif | 249 | #endif |
250 | 250 | ||
@@ -256,7 +256,7 @@ LUALIB_API int luaL_execresult (lua_State *L, int stat) { | |||
256 | if (stat == -1) /* error? */ | 256 | if (stat == -1) /* error? */ |
257 | return luaL_fileresult(L, 0, NULL); | 257 | return luaL_fileresult(L, 0, NULL); |
258 | else { | 258 | else { |
259 | inspectstat(stat, what); /* interpret result */ | 259 | l_inspectstat(stat, what); /* interpret result */ |
260 | if (*what == 'e' && stat == 0) /* successful termination? */ | 260 | if (*what == 'e' && stat == 0) /* successful termination? */ |
261 | lua_pushboolean(L, 1); | 261 | lua_pushboolean(L, 1); |
262 | else | 262 | else |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: liolib.c,v 2.133 2014/10/17 16:28:21 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.134 2014/10/17 19:17:55 roberto Exp roberto $ |
3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -418,8 +418,8 @@ static int readdigits (RN *rn, int hex) { | |||
418 | 418 | ||
419 | 419 | ||
420 | /* access to locale "radix character" (decimal point) */ | 420 | /* access to locale "radix character" (decimal point) */ |
421 | #if !defined(getlocaledecpoint) | 421 | #if !defined(l_getlocaledecpoint) |
422 | #define getlocaledecpoint() (localeconv()->decimal_point[0]) | 422 | #define l_getlocaledecpoint() (localeconv()->decimal_point[0]) |
423 | #endif | 423 | #endif |
424 | 424 | ||
425 | 425 | ||
@@ -434,7 +434,7 @@ static int read_number (lua_State *L, FILE *f) { | |||
434 | int hex = 0; | 434 | int hex = 0; |
435 | char decp[2] = "."; | 435 | char decp[2] = "."; |
436 | rn.f = f; rn.n = 0; | 436 | rn.f = f; rn.n = 0; |
437 | decp[0] = getlocaledecpoint(); /* get decimal point from locale */ | 437 | decp[0] = l_getlocaledecpoint(); /* get decimal point from locale */ |
438 | l_lockfile(rn.f); | 438 | l_lockfile(rn.f); |
439 | do { rn.c = l_getc(rn.f); } while (isspace(rn.c)); /* skip spaces */ | 439 | do { rn.c = l_getc(rn.f); } while (isspace(rn.c)); /* skip spaces */ |
440 | test2(&rn, "-+"); /* optional signal */ | 440 | test2(&rn, "-+"); /* optional signal */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.82 2014/10/10 22:23:04 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.83 2014/10/17 16:28:21 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -218,8 +218,8 @@ static void buffreplace (LexState *ls, char from, char to) { | |||
218 | } | 218 | } |
219 | 219 | ||
220 | 220 | ||
221 | #if !defined(getlocaledecpoint) | 221 | #if !defined(l_getlocaledecpoint) |
222 | #define getlocaledecpoint() (localeconv()->decimal_point[0]) | 222 | #define l_getlocaledecpoint() (localeconv()->decimal_point[0]) |
223 | #endif | 223 | #endif |
224 | 224 | ||
225 | 225 | ||
@@ -231,7 +231,7 @@ static void buffreplace (LexState *ls, char from, char to) { | |||
231 | */ | 231 | */ |
232 | static void trydecpoint (LexState *ls, TValue *o) { | 232 | static void trydecpoint (LexState *ls, TValue *o) { |
233 | char old = ls->decpoint; | 233 | char old = ls->decpoint; |
234 | ls->decpoint = getlocaledecpoint(); | 234 | ls->decpoint = l_getlocaledecpoint(); |
235 | buffreplace(ls, old, ls->decpoint); /* try new decimal separator */ | 235 | buffreplace(ls, old, ls->decpoint); /* try new decimal separator */ |
236 | if (!buff2num(ls->buff, o)) { | 236 | if (!buff2num(ls->buff, o)) { |
237 | /* format error with correct decimal point: no more options */ | 237 | /* format error with correct decimal point: no more options */ |