The Battle for Wesnoth  1.15.11+dev
Classes | Macros | Typedefs | Enumerations | Functions | Variables
lstrlib.cpp File Reference
#include "lprefix.h"
#include <ctype.h>
#include <float.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Include dependency graph for lstrlib.cpp:

Go to the source code of this file.

Classes

struct  str_Writer
 
struct  MatchState
 
struct  GMatchState
 
struct  cD
 
union  Ftypes
 
struct  Header
 

Macros

#define lstrlib_c
 
#define LUA_LIB
 
#define LUA_MAXCAPTURES   32
 
#define uchar(c)   ((unsigned char)(c))
 
#define MAX_SIZET   ((size_t)(~(size_t)0))
 
#define MAXSIZE   (sizeof(size_t) < sizeof(int) ? MAX_SIZET : (size_t)(INT_MAX))
 
#define CAP_UNFINISHED   (-1)
 
#define CAP_POSITION   (-2)
 
#define MAXCCALLS   200
 
#define L_ESC   '%'
 
#define SPECIALS   "^$*+?.([%-"
 
#define MAX_ITEMF   (110 + l_floatatt(MAX_10_EXP))
 
#define MAX_ITEM   120
 
#define L_FMTFLAGS   "-+ #0"
 
#define MAX_FORMAT   32
 
#define LUAL_PACKPADBYTE   0x00
 
#define MAXINTSIZE   16
 
#define NB   CHAR_BIT
 
#define MC   ((1 << NB) - 1)
 
#define SZINT   ((int)sizeof(lua_Integer))
 
#define MAXALIGN   (offsetof(struct cD, u))
 

Typedefs

typedef struct MatchState MatchState
 
typedef struct GMatchState GMatchState
 
typedef union Ftypes Ftypes
 
typedef struct Header Header
 
typedef enum KOption KOption
 

Enumerations

enum  KOption {
  Kint, Kuint, Kfloat, Kchar,
  Kstring, Kzstr, Kpadding, Kpaddalign,
  Knop
}
 

Functions

static int str_len (lua_State *L)
 
static size_t posrelatI (lua_Integer pos, size_t len)
 
static size_t getendpos (lua_State *L, int arg, lua_Integer def, size_t len)
 
static int str_sub (lua_State *L)
 
static int str_reverse (lua_State *L)
 
static int str_lower (lua_State *L)
 
static int str_upper (lua_State *L)
 
static int str_rep (lua_State *L)
 
static int str_byte (lua_State *L)
 
static int str_char (lua_State *L)
 
static int writer (lua_State *L, const void *b, size_t size, void *ud)
 
static int str_dump (lua_State *L)
 
static int tonum (lua_State *L, int arg)
 
static void trymt (lua_State *L, const char *mtname)
 
static int arith (lua_State *L, int op, const char *mtname)
 
static int arith_add (lua_State *L)
 
static int arith_sub (lua_State *L)
 
static int arith_mul (lua_State *L)
 
static int arith_mod (lua_State *L)
 
static int arith_pow (lua_State *L)
 
static int arith_div (lua_State *L)
 
static int arith_idiv (lua_State *L)
 
static int arith_unm (lua_State *L)
 
static const char * match (MatchState *ms, const char *s, const char *p)
 
static int check_capture (MatchState *ms, int l)
 
static int capture_to_close (MatchState *ms)
 
static const char * classend (MatchState *ms, const char *p)
 
static int match_class (int c, int cl)
 
static int matchbracketclass (int c, const char *p, const char *ec)
 
static int singlematch (MatchState *ms, const char *s, const char *p, const char *ep)
 
static const char * matchbalance (MatchState *ms, const char *s, const char *p)
 
static const char * max_expand (MatchState *ms, const char *s, const char *p, const char *ep)
 
static const char * min_expand (MatchState *ms, const char *s, const char *p, const char *ep)
 
static const char * start_capture (MatchState *ms, const char *s, const char *p, int what)
 
static const char * end_capture (MatchState *ms, const char *s, const char *p)
 
static const char * match_capture (MatchState *ms, const char *s, int l)
 
static const char * lmemfind (const char *s1, size_t l1, const char *s2, size_t l2)
 
static size_t get_onecapture (MatchState *ms, int i, const char *s, const char *e, const char **cap)
 
static void push_onecapture (MatchState *ms, int i, const char *s, const char *e)
 
static int push_captures (MatchState *ms, const char *s, const char *e)
 
static int nospecials (const char *p, size_t l)
 
static void prepstate (MatchState *ms, lua_State *L, const char *s, size_t ls, const char *p, size_t lp)
 
static void reprepstate (MatchState *ms)
 
static int str_find_aux (lua_State *L, int find)
 
static int str_find (lua_State *L)
 
static int str_match (lua_State *L)
 
static int gmatch_aux (lua_State *L)
 
static int gmatch (lua_State *L)
 
static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, const char *e)
 
static int add_value (MatchState *ms, luaL_Buffer *b, const char *s, const char *e, int tr)
 
static int str_gsub (lua_State *L)
 
static void addquoted (luaL_Buffer *b, const char *s, size_t len)
 
static int quotefloat (lua_State *L, char *buff, lua_Number n)
 
static void addliteral (lua_State *L, luaL_Buffer *b, int arg)
 
static const char * scanformat (lua_State *L, const char *strfrmt, char *form)
 
static void addlenmod (char *form, const char *lenmod)
 
static int str_format (lua_State *L)
 
static int digit (int c)
 
static int getnum (const char **fmt, int df)
 
static int getnumlimit (Header *h, const char **fmt, int df)
 
static void initheader (lua_State *L, Header *h)
 
static KOption getoption (Header *h, const char **fmt, int *size)
 
static KOption getdetails (Header *h, size_t totalsize, const char **fmt, int *psize, int *ntoalign)
 
static void packint (luaL_Buffer *b, lua_Unsigned n, int islittle, int size, int neg)
 
static void copywithendian (char *dest, const char *src, int size, int islittle)
 
static int str_pack (lua_State *L)
 
static int str_packsize (lua_State *L)
 
static lua_Integer unpackint (lua_State *L, const char *str, int islittle, int size, int issigned)
 
static int str_unpack (lua_State *L)
 
static void createmetatable (lua_State *L)
 
LUAMOD_API int luaopen_string (lua_State *L)
 

Variables

static const luaL_Reg stringmetamethods []
 
union {
   int   dummy
 
   char   little
 
nativeendian = {1}
 
static const luaL_Reg strlib []
 

Macro Definition Documentation

◆ CAP_POSITION

#define CAP_POSITION   (-2)

Definition at line 353 of file lstrlib.cpp.

Referenced by add_s(), get_onecapture(), match(), and push_onecapture().

◆ CAP_UNFINISHED

#define CAP_UNFINISHED   (-1)

Definition at line 352 of file lstrlib.cpp.

Referenced by capture_to_close(), check_capture(), end_capture(), get_onecapture(), and match().

◆ L_ESC

#define L_ESC   '%'

Definition at line 380 of file lstrlib.cpp.

Referenced by add_s(), classend(), match(), matchbracketclass(), singlematch(), and str_format().

◆ L_FMTFLAGS

#define L_FMTFLAGS   "-+ #0"

Definition at line 1091 of file lstrlib.cpp.

Referenced by scanformat().

◆ lstrlib_c

#define lstrlib_c

Definition at line 7 of file lstrlib.cpp.

◆ LUA_LIB

#define LUA_LIB

Definition at line 8 of file lstrlib.cpp.

◆ LUA_MAXCAPTURES

#define LUA_MAXCAPTURES   32

Definition at line 35 of file lstrlib.cpp.

Referenced by start_capture().

◆ LUAL_PACKPADBYTE

#define LUAL_PACKPADBYTE   0x00

Definition at line 1329 of file lstrlib.cpp.

Referenced by str_pack().

◆ MAX_FORMAT

#define MAX_FORMAT   32

Definition at line 1098 of file lstrlib.cpp.

Referenced by str_format().

◆ MAX_ITEM

#define MAX_ITEM   120

Definition at line 1086 of file lstrlib.cpp.

Referenced by addliteral(), quotefloat(), and str_format().

◆ MAX_ITEMF

#define MAX_ITEMF   (110 + l_floatatt(MAX_10_EXP))

Definition at line 1075 of file lstrlib.cpp.

Referenced by str_format().

◆ MAX_SIZET

#define MAX_SIZET   ((size_t)(~(size_t)0))

Definition at line 47 of file lstrlib.cpp.

◆ MAXALIGN

#define MAXALIGN   (offsetof(struct cD, u))

Definition at line 1358 of file lstrlib.cpp.

Referenced by getoption().

◆ MAXCCALLS

#define MAXCCALLS   200

Definition at line 376 of file lstrlib.cpp.

Referenced by prepstate(), and reprepstate().

◆ MAXINTSIZE

#define MAXINTSIZE   16

Definition at line 1333 of file lstrlib.cpp.

Referenced by getnumlimit().

◆ MAXSIZE

#define MAXSIZE   (sizeof(size_t) < sizeof(int) ? MAX_SIZET : (size_t)(INT_MAX))

Definition at line 49 of file lstrlib.cpp.

Referenced by getnum(), str_packsize(), and str_rep().

◆ MC

#define MC   ((1 << NB) - 1)

Definition at line 1339 of file lstrlib.cpp.

Referenced by packint(), and unpackint().

◆ NB

#define NB   CHAR_BIT

Definition at line 1336 of file lstrlib.cpp.

Referenced by packint(), str_pack(), and unpackint().

◆ SPECIALS

#define SPECIALS   "^$*+?.([%-"

Definition at line 381 of file lstrlib.cpp.

Referenced by nospecials().

◆ SZINT

#define SZINT   ((int)sizeof(lua_Integer))

Definition at line 1342 of file lstrlib.cpp.

Referenced by packint(), str_pack(), and unpackint().

◆ uchar

#define uchar (   c)    ((unsigned char)(c))

Typedef Documentation

◆ Ftypes

typedef union Ftypes Ftypes

◆ GMatchState

typedef struct GMatchState GMatchState

◆ Header

typedef struct Header Header

◆ KOption

typedef enum KOption KOption

◆ MatchState

typedef struct MatchState MatchState

Enumeration Type Documentation

◆ KOption

enum KOption
Enumerator
Kint 
Kuint 
Kfloat 
Kchar 
Kstring 
Kzstr 
Kpadding 
Kpaddalign 
Knop 

Definition at line 1384 of file lstrlib.cpp.

Function Documentation

◆ add_s()

static void add_s ( MatchState ms,
luaL_Buffer b,
const char *  s,
const char *  e 
)
static

◆ add_value()

static int add_value ( MatchState ms,
luaL_Buffer b,
const char *  s,
const char *  e,
int  tr 
)
static

◆ addlenmod()

static void addlenmod ( char *  form,
const char *  lenmod 
)
static

Definition at line 1214 of file lstrlib.cpp.

Referenced by str_format().

◆ addliteral()

static void addliteral ( lua_State L,
luaL_Buffer b,
int  arg 
)
static

◆ addquoted()

static void addquoted ( luaL_Buffer b,
const char *  s,
size_t  len 
)
static

Definition at line 1101 of file lstrlib.cpp.

References l_sprintf, luaL_addchar, luaL_addstring(), and uchar.

Referenced by addliteral().

◆ arith()

static int arith ( lua_State L,
int  op,
const char *  mtname 
)
static

Definition at line 286 of file lstrlib.cpp.

References lua_arith(), tonum(), and trymt().

Referenced by arith_add(), arith_div(), arith_idiv(), arith_mod(), arith_mul(), arith_pow(), arith_sub(), and arith_unm().

◆ arith_add()

static int arith_add ( lua_State L)
static

Definition at line 295 of file lstrlib.cpp.

References arith(), and LUA_OPADD.

◆ arith_div()

static int arith_div ( lua_State L)
static

Definition at line 315 of file lstrlib.cpp.

References arith(), and LUA_OPDIV.

◆ arith_idiv()

static int arith_idiv ( lua_State L)
static

Definition at line 319 of file lstrlib.cpp.

References arith(), and LUA_OPIDIV.

◆ arith_mod()

static int arith_mod ( lua_State L)
static

Definition at line 307 of file lstrlib.cpp.

References arith(), and LUA_OPMOD.

◆ arith_mul()

static int arith_mul ( lua_State L)
static

Definition at line 303 of file lstrlib.cpp.

References arith(), and LUA_OPMUL.

◆ arith_pow()

static int arith_pow ( lua_State L)
static

Definition at line 311 of file lstrlib.cpp.

References arith(), and LUA_OPPOW.

◆ arith_sub()

static int arith_sub ( lua_State L)
static

Definition at line 299 of file lstrlib.cpp.

References arith(), and LUA_OPSUB.

◆ arith_unm()

static int arith_unm ( lua_State L)
static

Definition at line 323 of file lstrlib.cpp.

References arith(), and LUA_OPUNM.

◆ capture_to_close()

static int capture_to_close ( MatchState ms)
static

◆ check_capture()

static int check_capture ( MatchState ms,
int  l 
)
static

◆ classend()

static const char* classend ( MatchState ms,
const char *  p 
)
static

Definition at line 400 of file lstrlib.cpp.

References MatchState::L, L_ESC, luaL_error(), p, and MatchState::p_end.

Referenced by match().

◆ copywithendian()

static void copywithendian ( char *  dest,
const char *  src,
int  size,
int  islittle 
)
static

Definition at line 1537 of file lstrlib.cpp.

References nativeendian.

Referenced by str_pack(), and str_unpack().

◆ createmetatable()

static void createmetatable ( lua_State L)
static

◆ digit()

static int digit ( int  c)
static

Definition at line 1401 of file lstrlib.cpp.

Referenced by b_str2int(), and getnum().

◆ end_capture()

static const char* end_capture ( MatchState ms,
const char *  s,
const char *  p 
)
static

Definition at line 545 of file lstrlib.cpp.

References CAP_UNFINISHED, MatchState::capture, capture_to_close(), MatchState::init, MatchState::len, and match().

Referenced by match().

◆ get_onecapture()

static size_t get_onecapture ( MatchState ms,
int  i,
const char *  s,
const char *  e,
const char **  cap 
)
static

◆ getdetails()

static KOption getdetails ( Header h,
size_t  totalsize,
const char **  fmt,
int *  psize,
int *  ntoalign 
)
static

Definition at line 1489 of file lstrlib.cpp.

References getoption(), Kchar, Kpaddalign, Header::L, luaL_argerror(), and Header::maxalign.

Referenced by str_pack(), str_packsize(), and str_unpack().

◆ getendpos()

static size_t getendpos ( lua_State L,
int  arg,
lua_Integer  def,
size_t  len 
)
static

Definition at line 87 of file lstrlib.cpp.

References luaL_optinteger().

Referenced by str_byte(), and str_sub().

◆ getnum()

static int getnum ( const char **  fmt,
int  df 
)
static

Definition at line 1403 of file lstrlib.cpp.

References a, digit(), and MAXSIZE.

Referenced by getnumlimit(), and getoption().

◆ getnumlimit()

static int getnumlimit ( Header h,
const char **  fmt,
int  df 
)
static

Definition at line 1420 of file lstrlib.cpp.

References getnum(), Header::L, luaL_error(), and MAXINTSIZE.

Referenced by getoption().

◆ getoption()

static KOption getoption ( Header h,
const char **  fmt,
int *  size 
)
static

◆ gmatch()

static int gmatch ( lua_State L)
static

◆ gmatch_aux()

static int gmatch_aux ( lua_State L)
static

◆ initheader()

static void initheader ( lua_State L,
Header h 
)
static

Definition at line 1432 of file lstrlib.cpp.

References Header::islittle, Header::L, Header::maxalign, and nativeendian.

Referenced by str_pack(), str_packsize(), and str_unpack().

◆ lmemfind()

static const char* lmemfind ( const char *  s1,
size_t  l1,
const char *  s2,
size_t  l2 
)
static

Definition at line 670 of file lstrlib.cpp.

References str_Writer::init.

Referenced by str_find_aux().

◆ luaopen_string()

LUAMOD_API int luaopen_string ( lua_State L)

Definition at line 1797 of file lstrlib.cpp.

References createmetatable(), and luaL_newlib.

Referenced by lua_kernel_base::lua_kernel_base().

◆ match()

static const char * match ( MatchState ms,
const char *  s,
const char *  p 
)
static

◆ match_capture()

static const char* match_capture ( MatchState ms,
const char *  s,
int  l 
)
static

Definition at line 556 of file lstrlib.cpp.

References MatchState::capture, check_capture(), MatchState::init, MatchState::len, and MatchState::src_end.

Referenced by match().

◆ match_class()

static int match_class ( int  c,
int  cl 
)
static

Definition at line 424 of file lstrlib.cpp.

Referenced by matchbracketclass(), and singlematch().

◆ matchbalance()

static const char* matchbalance ( MatchState ms,
const char *  s,
const char *  p 
)
static

Definition at line 483 of file lstrlib.cpp.

References b, e, MatchState::L, luaL_error(), p, and MatchState::p_end.

Referenced by match().

◆ matchbracketclass()

static int matchbracketclass ( int  c,
const char *  p,
const char *  ec 
)
static

Definition at line 444 of file lstrlib.cpp.

References L_ESC, match_class(), and uchar.

Referenced by match(), and singlematch().

◆ max_expand()

static const char* max_expand ( MatchState ms,
const char *  s,
const char *  p,
const char *  ep 
)
static

Definition at line 503 of file lstrlib.cpp.

References i, match(), and singlematch().

Referenced by match().

◆ min_expand()

static const char* min_expand ( MatchState ms,
const char *  s,
const char *  p,
const char *  ep 
)
static

Definition at line 518 of file lstrlib.cpp.

References match(), and singlematch().

Referenced by match().

◆ nospecials()

static int nospecials ( const char *  p,
size_t  l 
)
static

Definition at line 743 of file lstrlib.cpp.

References SPECIALS.

Referenced by str_find_aux().

◆ packint()

static void packint ( luaL_Buffer b,
lua_Unsigned  n,
int  islittle,
int  size,
int  neg 
)
static

Definition at line 1516 of file lstrlib.cpp.

References i, luaL_addsize, luaL_prepbuffsize(), MC, NB, utf8::size(), and SZINT.

Referenced by str_pack().

◆ posrelatI()

static size_t posrelatI ( lua_Integer  pos,
size_t  len 
)
static

Definition at line 71 of file lstrlib.cpp.

Referenced by gmatch(), str_byte(), str_find_aux(), str_sub(), and str_unpack().

◆ prepstate()

static void prepstate ( MatchState ms,
lua_State L,
const char *  s,
size_t  ls,
const char *  p,
size_t  lp 
)
static

◆ push_captures()

static int push_captures ( MatchState ms,
const char *  s,
const char *  e 
)
static

Definition at line 732 of file lstrlib.cpp.

References i, MatchState::L, MatchState::level, luaL_checkstack(), push_onecapture(), and s.

Referenced by add_value(), gmatch_aux(), and str_find_aux().

◆ push_onecapture()

static void push_onecapture ( MatchState ms,
int  i,
const char *  s,
const char *  e 
)
static

Definition at line 722 of file lstrlib.cpp.

References CAP_POSITION, get_onecapture(), MatchState::L, and lua_pushlstring().

Referenced by add_value(), and push_captures().

◆ quotefloat()

static int quotefloat ( lua_State L,
char *  buff,
lua_Number  n 
)
static

Definition at line 1130 of file lstrlib.cpp.

References l_sprintf, lua_getlocaledecpoint, lua_number2strx, LUA_NUMBER_FRMLEN, MAX_ITEM, and s.

Referenced by addliteral().

◆ reprepstate()

static void reprepstate ( MatchState ms)
static

Definition at line 764 of file lstrlib.cpp.

References MatchState::level, lua_assert, MatchState::matchdepth, and MAXCCALLS.

Referenced by gmatch_aux(), str_find_aux(), and str_gsub().

◆ scanformat()

static const char* scanformat ( lua_State L,
const char *  strfrmt,
char *  form 
)
static

Definition at line 1189 of file lstrlib.cpp.

References L_FMTFLAGS, luaL_error(), p, and uchar.

Referenced by str_format().

◆ singlematch()

static int singlematch ( MatchState ms,
const char *  s,
const char *  p,
const char *  ep 
)
static

Definition at line 467 of file lstrlib.cpp.

References c, L_ESC, match_class(), matchbracketclass(), MatchState::src_end, and uchar.

Referenced by match(), max_expand(), and min_expand().

◆ start_capture()

static const char* start_capture ( MatchState ms,
const char *  s,
const char *  p,
int  what 
)
static

◆ str_byte()

static int str_byte ( lua_State L)
static

◆ str_char()

static int str_char ( lua_State L)
static

◆ str_dump()

static int str_dump ( lua_State L)
static

◆ str_find()

static int str_find ( lua_State L)
static

Definition at line 816 of file lstrlib.cpp.

References str_find_aux().

◆ str_find_aux()

static int str_find_aux ( lua_State L,
int  find 
)
static

◆ str_format()

static int str_format ( lua_State L)
static

◆ str_gsub()

static int str_gsub ( lua_State L)
static

◆ str_len()

static int str_len ( lua_State L)
static

Definition at line 55 of file lstrlib.cpp.

References lua_pushinteger(), and luaL_checklstring().

◆ str_lower()

static int str_lower ( lua_State L)
static

Definition at line 124 of file lstrlib.cpp.

References b, i, luaL_buffinitsize(), luaL_checklstring(), luaL_pushresultsize(), p, s, and uchar.

◆ str_match()

static int str_match ( lua_State L)
static

Definition at line 821 of file lstrlib.cpp.

References str_find_aux().

◆ str_pack()

static int str_pack ( lua_State L)
static

◆ str_packsize()

static int str_packsize ( lua_State L)
static

◆ str_rep()

static int str_rep ( lua_State L)
static

◆ str_reverse()

static int str_reverse ( lua_State L)
static

Definition at line 112 of file lstrlib.cpp.

References b, i, luaL_buffinitsize(), luaL_checklstring(), luaL_pushresultsize(), p, and s.

◆ str_sub()

static int str_sub ( lua_State L)
static

◆ str_unpack()

static int str_unpack ( lua_State L)
static

◆ str_upper()

static int str_upper ( lua_State L)
static

Definition at line 137 of file lstrlib.cpp.

References b, i, luaL_buffinitsize(), luaL_checklstring(), luaL_pushresultsize(), p, s, and uchar.

◆ tonum()

static int tonum ( lua_State L,
int  arg 
)
static

Definition at line 263 of file lstrlib.cpp.

References lua_pushvalue(), lua_stringtonumber(), LUA_TNUMBER, lua_tolstring(), lua_type(), and s.

Referenced by arith().

◆ trymt()

static void trymt ( lua_State L,
const char *  mtname 
)
static

Definition at line 276 of file lstrlib.cpp.

References lua_call, lua_insert, lua_settop(), LUA_TSTRING, lua_type(), luaL_error(), luaL_getmetafield(), and luaL_typename.

Referenced by arith().

◆ unpackint()

static lua_Integer unpackint ( lua_State L,
const char *  str,
int  islittle,
int  size,
int  issigned 
)
static

Definition at line 1664 of file lstrlib.cpp.

References i, luaL_error(), MC, NB, utf8::size(), and SZINT.

Referenced by str_unpack().

◆ writer()

static int writer ( lua_State L,
const void *  b,
size_t  size,
void *  ud 
)
static

Variable Documentation

◆ dummy

int dummy

◆ little

char little

Definition at line 1348 of file lstrlib.cpp.

◆ nativeendian

const { ... } nativeendian

◆ stringmetamethods

const luaL_Reg stringmetamethods[]
static
Initial value:
= {
{"__add", arith_add},
{"__sub", arith_sub},
{"__mul", arith_mul},
{"__mod", arith_mod},
{"__pow", arith_pow},
{"__div", arith_div},
{"__idiv", arith_idiv},
{"__unm", arith_unm},
{"__index", NULL},
{NULL, NULL}
}
static int arith_sub(lua_State *L)
Definition: lstrlib.cpp:299
static int arith_add(lua_State *L)
Definition: lstrlib.cpp:295
static int arith_idiv(lua_State *L)
Definition: lstrlib.cpp:319
static int arith_mul(lua_State *L)
Definition: lstrlib.cpp:303
static int arith_mod(lua_State *L)
Definition: lstrlib.cpp:307
static int arith_div(lua_State *L)
Definition: lstrlib.cpp:315
static int arith_unm(lua_State *L)
Definition: lstrlib.cpp:323
static int arith_pow(lua_State *L)
Definition: lstrlib.cpp:311

Definition at line 328 of file lstrlib.cpp.

Referenced by str_dump().

◆ strlib

const luaL_Reg strlib[]
static
Initial value:
= {
{"byte", str_byte},
{"char", str_char},
{"dump", str_dump},
{"find", str_find},
{"format", str_format},
{"gmatch", gmatch},
{"gsub", str_gsub},
{"len", str_len},
{"lower", str_lower},
{"match", str_match},
{"rep", str_rep},
{"reverse", str_reverse},
{"sub", str_sub},
{"upper", str_upper},
{"pack", str_pack},
{"packsize", str_packsize},
{"unpack", str_unpack},
{NULL, NULL}
}
static int str_dump(lua_State *L)
Definition: lstrlib.cpp:232
static int str_match(lua_State *L)
Definition: lstrlib.cpp:821
static int str_reverse(lua_State *L)
Definition: lstrlib.cpp:112
static int str_gsub(lua_State *L)
Definition: lstrlib.cpp:939
static int str_char(lua_State *L)
Definition: lstrlib.cpp:194
static int str_rep(lua_State *L)
Definition: lstrlib.cpp:150
static int str_byte(lua_State *L)
Definition: lstrlib.cpp:176
static int str_format(lua_State *L)
Definition: lstrlib.cpp:1224
static int str_pack(lua_State *L)
Definition: lstrlib.cpp:1549
static int str_packsize(lua_State *L)
Definition: lstrlib.cpp:1636
static int str_lower(lua_State *L)
Definition: lstrlib.cpp:124
static int str_unpack(lua_State *L)
Definition: lstrlib.cpp:1690
static int str_find(lua_State *L)
Definition: lstrlib.cpp:816
static int str_len(lua_State *L)
Definition: lstrlib.cpp:55
static int gmatch(lua_State *L)
Definition: lstrlib.cpp:851
static int str_upper(lua_State *L)
Definition: lstrlib.cpp:137
static int str_sub(lua_State *L)
Definition: lstrlib.cpp:100

Definition at line 1758 of file lstrlib.cpp.