The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions | Variables
lobject.cpp File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lctype.h"
#include "ldebug.h"
#include "ldo.h"
#include "lmem.h"
#include "lobject.h"
#include "lstate.h"
#include "lstring.h"
#include "lvm.h"
#include <math.h>
Include dependency graph for lobject.cpp:

Go to the source code of this file.

Macros

#define lobject_c
 
#define LUA_CORE
 
#define LL(x)   (sizeof(x)/sizeof(char) - 1)
 
#define RETS   "..."
 
#define PRE   "[string \""
 
#define POS   "\"]"
 
#define addstr(a, b, l)   ( memcpy(a,b,(l) * sizeof(char)), a += (l) )
 

Functions

int luaO_int2fb (unsigned int x)
 
int luaO_fb2int (int x)
 
int luaO_ceillog2 (unsigned int x)
 
lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2)
 
int luaO_hexavalue (int c)
 
static int isneg (const char **s)
 
static lua_Number readhexa (const char **s, lua_Number r, int *count)
 
static lua_Number lua_strx2number (const char *s, char **endptr)
 
int luaO_str2d (const char *s, size_t len, lua_Number *result)
 
static void pushstr (lua_State *L, const char *str, size_t l)
 
const char * luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp)
 
const char * luaO_pushfstring (lua_State *L, const char *fmt,...)
 
void luaO_chunkid (char *out, const char *source, size_t bufflen)
 

Variables

LUAI_DDEF const TValue luaO_nilobject_ = {NILCONSTANT}
 

Macro Definition Documentation

#define addstr (   a,
  b,
  l 
)    ( memcpy(a,b,(l) * sizeof(char)), a += (l) )

Definition at line 249 of file lobject.cpp.

Referenced by luaO_chunkid().

#define LL (   x)    (sizeof(x)/sizeof(char) - 1)

Definition at line 243 of file lobject.cpp.

Referenced by luaO_chunkid().

#define lobject_c

Definition at line 11 of file lobject.cpp.

#define LUA_CORE

Definition at line 12 of file lobject.cpp.

#define POS   "\"]"

Definition at line 247 of file lobject.cpp.

Referenced by luaO_chunkid().

#define PRE   "[string \""

Definition at line 246 of file lobject.cpp.

Referenced by luaO_chunkid().

#define RETS   "..."

Definition at line 245 of file lobject.cpp.

Referenced by luaO_chunkid().

Function Documentation

static int isneg ( const char **  s)
static

Definition at line 97 of file lobject.cpp.

Referenced by lua_strx2number().

static lua_Number lua_strx2number ( const char *  s,
char **  endptr 
)
static

Definition at line 117 of file lobject.cpp.

References cast, cast_uchar, e, exp1(), i, isneg(), l_mathop, lisdigit, lisspace, and readhexa().

Referenced by luaO_str2d().

lua_Number luaO_arith ( int  op,
lua_Number  v1,
lua_Number  v2 
)

Definition at line 72 of file lobject.cpp.

References lua_assert, LUA_OPADD, LUA_OPDIV, LUA_OPMOD, LUA_OPMUL, LUA_OPPOW, LUA_OPSUB, and LUA_OPUNM.

Referenced by constfolding(), lua_arith(), and luaV_arith().

int luaO_ceillog2 ( unsigned int  x)

Definition at line 54 of file lobject.cpp.

Referenced by countint(), and setnodevector().

void luaO_chunkid ( char *  out,
const char *  source,
size_t  bufflen 
)

Definition at line 251 of file lobject.cpp.

References addstr, LL, POS, PRE, and RETS.

Referenced by addinfo(), funcinfo(), and lexerror().

int luaO_fb2int ( int  x)

Definition at line 47 of file lobject.cpp.

References e.

Referenced by luaV_execute().

int luaO_hexavalue ( int  c)

Definition at line 86 of file lobject.cpp.

References lisdigit, and ltolower.

Referenced by readhexa(), and readhexaesc().

int luaO_int2fb ( unsigned int  x)

Definition at line 35 of file lobject.cpp.

References cast_int, and e.

Referenced by constructor().

const char* luaO_pushfstring ( lua_State L,
const char *  fmt,
  ... 
)
const char* luaO_pushvfstring ( lua_State L,
const char *  fmt,
va_list  argp 
)
int luaO_str2d ( const char *  s,
size_t  len,
lua_Number result 
)

Definition at line 157 of file lobject.cpp.

References cast_uchar, lisspace, lua_str2number, and lua_strx2number().

Referenced by luaV_tonumber().

static void pushstr ( lua_State L,
const char *  str,
size_t  l 
)
static

Definition at line 172 of file lobject.cpp.

References luaS_newlstr(), setsvalue2s, and lua_State::top.

Referenced by luaO_pushvfstring().

static lua_Number readhexa ( const char **  s,
lua_Number  r,
int count 
)
static

Definition at line 104 of file lobject.cpp.

References cast_num, cast_uchar, lisxdigit, and luaO_hexavalue().

Referenced by lua_strx2number().

Variable Documentation

LUAI_DDEF const TValue luaO_nilobject_ = {NILCONSTANT}

Definition at line 27 of file lobject.cpp.