diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-03-20 09:54:08 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-03-20 09:54:08 -0300 |
commit | 88c9bf99de50df5575cce13e8e6c278b9f1dc0d0 (patch) | |
tree | 3cfe2080f0a2595b62b74752c84ffa763e83f8e6 /lstrlib.c | |
parent | 63a614e1453b6b03b89b5d47efa476acd5f9d1d2 (diff) | |
download | lua-88c9bf99de50df5575cce13e8e6c278b9f1dc0d0.tar.gz lua-88c9bf99de50df5575cce13e8e6c278b9f1dc0d0.tar.bz2 lua-88c9bf99de50df5575cce13e8e6c278b9f1dc0d0.zip |
standard libraries in packages
Diffstat (limited to 'lstrlib.c')
-rw-r--r-- | lstrlib.c | 30 |
1 files changed, 16 insertions, 14 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.77 2002/02/08 22:39:36 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.78 2002/03/11 13:29:40 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 | */ |
@@ -707,18 +707,19 @@ static int str_format (lua_State *L) { | |||
707 | 707 | ||
708 | 708 | ||
709 | static const luaL_reg strlib[] = { | 709 | static const luaL_reg strlib[] = { |
710 | {"strlen", str_len}, | 710 | {"len", str_len}, |
711 | {"strsub", str_sub}, | 711 | {"sub", str_sub}, |
712 | {"strlower", str_lower}, | 712 | {"lower", str_lower}, |
713 | {"strupper", str_upper}, | 713 | {"upper", str_upper}, |
714 | {"strchar", str_char}, | 714 | {"char", str_char}, |
715 | {"strrep", str_rep}, | 715 | {"rep", str_rep}, |
716 | {"strbyte", str_byte}, | 716 | {"byte", str_byte}, |
717 | {"concat", str_concat}, | 717 | {"concat", str_concat}, |
718 | {"format", str_format}, | 718 | {"format", str_format}, |
719 | {"strfind", str_find}, | 719 | {"find", str_find}, |
720 | {"gfind", gfind}, | 720 | {"gfind", gfind}, |
721 | {"gsub", str_gsub} | 721 | {"gsub", str_gsub}, |
722 | {NULL, NULL} | ||
722 | }; | 723 | }; |
723 | 724 | ||
724 | 725 | ||
@@ -726,6 +727,7 @@ static const luaL_reg strlib[] = { | |||
726 | ** Open string library | 727 | ** Open string library |
727 | */ | 728 | */ |
728 | LUALIB_API int lua_strlibopen (lua_State *L) { | 729 | LUALIB_API int lua_strlibopen (lua_State *L) { |
729 | luaL_openl(L, strlib); | 730 | luaL_opennamedlib(L, "str", strlib); |
730 | return 0; | 731 | return 0; |
731 | } | 732 | } |
733 | |||