diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-31 13:53:31 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-31 13:53:31 -0200 |
commit | dcfc3c9405fac62c5808c33e1b4c82c45c5b2218 (patch) | |
tree | ce48220cf2ff08dceb1ad71ac2dbe865da2fec66 /lstrlib.c | |
parent | 4542fb9f78ff72c6bc72be76385f9710ffee867a (diff) | |
download | lua-dcfc3c9405fac62c5808c33e1b4c82c45c5b2218.tar.gz lua-dcfc3c9405fac62c5808c33e1b4c82c45c5b2218.tar.bz2 lua-dcfc3c9405fac62c5808c33e1b4c82c45c5b2218.zip |
new option '=' (native endian) for pack/unpack
Diffstat (limited to 'lstrlib.c')
-rw-r--r-- | lstrlib.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.209 2014/10/28 18:23:31 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.210 2014/10/30 18:53:28 roberto Exp roberto $ |
3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -1086,6 +1086,7 @@ static KOption getoption (Header *h, const char **fmt, int *size) { | |||
1086 | case ' ': return Knop; | 1086 | case ' ': return Knop; |
1087 | case '<': h->islittle = 1; return Knop; | 1087 | case '<': h->islittle = 1; return Knop; |
1088 | case '>': h->islittle = 0; return Knop; | 1088 | case '>': h->islittle = 0; return Knop; |
1089 | case '=': h->islittle = nativeendian.little; return Knop; | ||
1089 | case '!': h->maxalign = getnumlimit(h, fmt, MAXALIGN); return Knop; | 1090 | case '!': h->maxalign = getnumlimit(h, fmt, MAXALIGN); return Knop; |
1090 | default: { | 1091 | default: { |
1091 | luaL_error(h->L, "invalid format option '%c'", opt); | 1092 | luaL_error(h->L, "invalid format option '%c'", opt); |