Lua 5.1.4: llimits.h


L0001    /*
L0002    ** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $
L0003    ** Limits, basic types, and some other `installation-dependent' definitions
L0004    ** See Copyright Notice in lua.h
L0005    */
L0006    
L0007    #ifndef llimits_h
L0008    #define llimits_h
L0009    
L0010    
L0011    #include <limits.h>
L0012    #include <stddef.h>
L0013    
L0014    
L0015    #include "lua.h"
L0016    
L0017    
L0018    typedef LUAI_UINT32 lu_int32;
L0019    
L0020    typedef LUAI_UMEM lu_mem;
L0021    
L0022    typedef LUAI_MEM l_mem;
L0023    
L0024    
L0025    
L0026    /* chars used as small naturals (so that `char' is reserved for characters) */
L0027    typedef unsigned char lu_byte;
L0028    
L0029    
L0030    #define MAX_SIZET	((size_t)(~(size_t)0)-2)
L0031    
L0032    #define MAX_LUMEM	((lu_mem)(~(lu_mem)0)-2)
L0033    
L0034    
L0035    #define MAX_INT (INT_MAX-2)  /* maximum value of an int (-2 for safety) */
L0036    
L0037    /*
L0038    ** conversion of pointer to integer
L0039    ** this is for hashing only; there is no problem if the integer
L0040    ** cannot hold the whole pointer value
L0041    */
L0042    #define IntPoint(p)  ((unsigned int)(lu_mem)(p))
L0043    
L0044    
L0045    
L0046    /* type to ensure maximum alignment */
L0047    typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
L0048    
L0049    
L0050    /* result of a `usual argument conversion' over lua_Number */
L0051    typedef LUAI_UACNUMBER l_uacNumber;
L0052    
L0053    
L0054    /* internal assertions for in-house debugging */
L0055    #ifdef lua_assert
L0056    
L0057    #define check_exp(c,e)		(lua_assert(c), (e))
L0058    #define api_check(l,e)		lua_assert(e)
L0059    
L0060    #else
L0061    
L0062    #define lua_assert(c)		((void)0)
L0063    #define check_exp(c,e)		(e)
L0064    #define api_check		luai_apicheck
L0065    
L0066    #endif
L0067    
L0068    
L0069    #ifndef UNUSED
L0070    #define UNUSED(x)	((void)(x))	/* to avoid warnings */
L0071    #endif
L0072    
L0073    
L0074    #ifndef cast
L0075    #define cast(t, exp)	((t)(exp))
L0076    #endif
L0077    
L0078    #define cast_byte(i)	cast(lu_byte, (i))
L0079    #define cast_num(i)	cast(lua_Number, (i))
L0080    #define cast_int(i)	cast(int, (i))
L0081    
L0082    
L0083    
L0084    /*
L0085    ** type for virtual-machine instructions
L0086    ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h)
L0087    */
L0088    typedef lu_int32 Instruction;
L0089    
L0090    
L0091    
L0092    /* maximum stack for a Lua function */
L0093    #define MAXSTACK	250
Note: must fix in byte (lu_byte)--see Proto::maxstacksize.
L0094 L0095 L0096 L0097 /* minimum size for the string table (must be power of 2) */ L0098 #ifndef MINSTRTABSIZE L0099
#define MINSTRTABSIZE 32 L0100 #endif L0101 L0102 L0103 /* minimum size for string buffer */ L0104 #ifndef LUA_MINBUFFER L0105 #define LUA_MINBUFFER 32 L0106 #endif L0107 L0108 L0109 #ifndef lua_lock L0110 #define lua_lock(L) ((void) 0) L0111 #define lua_unlock(L) ((void) 0) L0112 #endif L0113 L0114 #ifndef luai_threadyield L0115 #define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} L0116 #endif L0117 L0118 L0119 /* L0120 ** macro to control inclusion of some hard tests on stack reallocation L0121 */ L0122 #ifndef HARDSTACKTESTS L0123 #define condhardstacktests(x) ((void)0) L0124 #else L0125 #define condhardstacktests(x) x L0126 #endif L0127 L0128 #endif

Generated by
pretty.lua