Otclient  14/8/2020
lbitlib.cpp File Reference
#include <lua.h>
#include <lauxlib.h>
#include "lualib.h"
Include dependency graph for lbitlib.cpp:

Go to the source code of this file.

Macros

#define LUA_LIB
 
#define LUAI_INT32   int
 
#define LUA_UNSIGNED   unsigned LUAI_INT32
 
#define lua_number2unsigned(i, n)   ((i)=(lua_Unsigned)(n))
 
#define lua_unsigned2number(u)   (((u) <= (lua_Unsigned)INT_MAX) ? (lua_Number)(int)(u) : (lua_Number)(u))
 
#define LUAMOD_API   LUALIB_API
 
#define LUA_BIT32LIBNAME   "bit32"
 
#define luaL_newlib(x, y)   luaL_register(x, LUA_BIT32LIBNAME, y)
 
#define lbitlib_c
 
#define LUA_LIB
 
#define LUA_NBITS   32
 
#define ALLONES   (~(((~(lua_Unsigned)0) << (LUA_NBITS - 1)) << 1))
 
#define trim(x)   ((x) & ALLONES)
 
#define mask(n)   (~((ALLONES << 1) << ((n) - 1)))
 

Typedefs

typedef LUA_UNSIGNED lua_Unsigned
 
typedef lua_Unsigned b_uint
 

Functions

int luaopen_bit32 (lua_State *L)
 

Macro Definition Documentation

◆ ALLONES

#define ALLONES   (~(((~(lua_Unsigned)0) << (LUA_NBITS - 1)) << 1))

Definition at line 190 of file lbitlib.cpp.

◆ lbitlib_c

#define lbitlib_c

Definition at line 175 of file lbitlib.cpp.

◆ LUA_BIT32LIBNAME

#define LUA_BIT32LIBNAME   "bit32"

Definition at line 160 of file lbitlib.cpp.

◆ LUA_LIB [1/2]

#define LUA_LIB

Definition at line 176 of file lbitlib.cpp.

◆ LUA_LIB [2/2]

#define LUA_LIB

Definition at line 176 of file lbitlib.cpp.

◆ LUA_NBITS

#define LUA_NBITS   32

Definition at line 186 of file lbitlib.cpp.

◆ lua_number2unsigned

#define lua_number2unsigned (   i,
 
)    ((i)=(lua_Unsigned)(n))

Definition at line 130 of file lbitlib.cpp.

◆ LUA_UNSIGNED

#define LUA_UNSIGNED   unsigned LUAI_INT32

Definition at line 49 of file lbitlib.cpp.

◆ lua_unsigned2number

#define lua_unsigned2number (   u)    (((u) <= (lua_Unsigned)INT_MAX) ? (lua_Number)(int)(u) : (lua_Number)(u))

Definition at line 136 of file lbitlib.cpp.

◆ LUAI_INT32

#define LUAI_INT32   int

Definition at line 47 of file lbitlib.cpp.

◆ luaL_newlib

#define luaL_newlib (   x,
 
)    luaL_register(x, LUA_BIT32LIBNAME, y)

Definition at line 161 of file lbitlib.cpp.

◆ LUAMOD_API

#define LUAMOD_API   LUALIB_API

Definition at line 159 of file lbitlib.cpp.

◆ mask

#define mask (   n)    (~((ALLONES << 1) << ((n) - 1)))

Definition at line 197 of file lbitlib.cpp.

◆ trim

#define trim (   x)    ((x) & ALLONES)

Definition at line 193 of file lbitlib.cpp.

Typedef Documentation

◆ b_uint

Definition at line 200 of file lbitlib.cpp.

◆ lua_Unsigned

Definition at line 85 of file lbitlib.cpp.

Function Documentation

◆ luaopen_bit32()

int luaopen_bit32 ( lua_State *  L)

Definition at line 371 of file lbitlib.cpp.

Here is the caller graph for this function: