@@ -2957,57 +2957,57 @@ pub const Lua = struct {
2957
2957
2958
2958
/// Open the basic standard library
2959
2959
pub fn openBase (lua : * Lua ) void {
2960
- _ = c .luaopen_base ( lua . state );
2960
+ lua . requireF ( "_G" , c .luaopen_base , true );
2961
2961
}
2962
2962
2963
2963
/// Open the coroutine standard library
2964
2964
pub fn openCoroutine (lua : * Lua ) void {
2965
- _ = c .luaopen_coroutine ( lua . state );
2965
+ lua . requireF ( c . LUA_COLIBNAME , c .luaopen_coroutine , true );
2966
2966
}
2967
2967
2968
2968
/// Open the package standard library
2969
2969
pub fn openPackage (lua : * Lua ) void {
2970
- _ = c .luaopen_package ( lua . state );
2970
+ lua . requireF ( c . LUA_LOADLIBNAME , c .luaopen_package , true );
2971
2971
}
2972
2972
2973
2973
/// Open the string standard library
2974
2974
pub fn openString (lua : * Lua ) void {
2975
- _ = c .luaopen_string ( lua . state );
2975
+ lua . requireF ( c . LUA_STRLIBNAME , c .luaopen_string , true );
2976
2976
}
2977
2977
2978
2978
/// Open the UTF-8 standard library
2979
2979
pub fn openUtf8 (lua : * Lua ) void {
2980
- _ = c .luaopen_utf8 ( lua . state );
2980
+ lua . requireF ( c . LUA_UTF8LIBNAME , c .luaopen_utf8 , true );
2981
2981
}
2982
2982
2983
2983
/// Open the table standard library
2984
2984
pub fn openTable (lua : * Lua ) void {
2985
- _ = c .luaopen_table ( lua . state );
2985
+ lua . requireF ( c . LUA_TABLIBNAME , c .luaopen_table , true );
2986
2986
}
2987
2987
2988
2988
/// Open the math standard library
2989
2989
pub fn openMath (lua : * Lua ) void {
2990
- _ = c .luaopen_math ( lua . state );
2990
+ lua . requireF ( c . LUA_MATHLIBNAME , c .luaopen_math , true );
2991
2991
}
2992
2992
2993
2993
/// Open the io standard library
2994
2994
pub fn openIO (lua : * Lua ) void {
2995
- _ = c .luaopen_io ( lua . state );
2995
+ lua . requireF ( c . LUA_IOLIBNAME , c .luaopen_io , true );
2996
2996
}
2997
2997
2998
2998
/// Open the os standard library
2999
2999
pub fn openOS (lua : * Lua ) void {
3000
- _ = c .luaopen_os ( lua . state );
3000
+ lua . requireF ( c . LUA_OSLIBNAME , c .luaopen_os , true );
3001
3001
}
3002
3002
3003
3003
/// Open the debug standard library
3004
3004
pub fn openDebug (lua : * Lua ) void {
3005
- _ = c .luaopen_debug ( lua . state );
3005
+ lua . requireF ( c . LUA_DBLIBNAME , c .luaopen_debug , true );
3006
3006
}
3007
3007
3008
3008
/// Open the bit32 standard library
3009
3009
pub fn openBit32 (lua : * Lua ) void {
3010
- _ = c .luaopen_bit32 ( lua . state );
3010
+ lua . requireF ( c . LUA_BITLIBNAME , c .luaopen_bit32 , true );
3011
3011
}
3012
3012
3013
3013
/// Returns if given typeinfo is a string type
0 commit comments