RetroArch
Macros | Functions | Variables
lutf8lib.c File Reference
#include "lprefix.h"
#include <assert.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Include dependency graph for lutf8lib.c:

Macros

#define lutf8lib_c
 
#define LUA_LIB
 
#define MAXUNICODE   0x10FFFF
 
#define iscont(p)   ((*(p) & 0xC0) == 0x80)
 
#define UTF8PATT   "[\0-\x7F\xC2-\xF4][\x80-\xBF]*"
 

Functions

static lua_Integer u_posrelat (lua_Integer pos, size_t len)
 
static const char * utf8_decode (const char *o, int *val)
 
static int utflen (lua_State *L)
 
static int codepoint (lua_State *L)
 
static void pushutfchar (lua_State *L, int arg)
 
static int utfchar (lua_State *L)
 
static int byteoffset (lua_State *L)
 
static int iter_aux (lua_State *L)
 
static int iter_codes (lua_State *L)
 
LUAMOD_API int luaopen_utf8 (lua_State *L)
 

Variables

static const luaL_Reg funcs []
 

Macro Definition Documentation

◆ iscont

#define iscont (   p)    ((*(p) & 0xC0) == 0x80)

◆ LUA_LIB

#define LUA_LIB

◆ lutf8lib_c

#define lutf8lib_c

◆ MAXUNICODE

#define MAXUNICODE   0x10FFFF

◆ UTF8PATT

#define UTF8PATT   "[\0-\x7F\xC2-\xF4][\x80-\xBF]*"

Function Documentation

◆ byteoffset()

static int byteoffset ( lua_State L)
static
Here is the call graph for this function:

◆ codepoint()

static int codepoint ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ iter_aux()

static int iter_aux ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ iter_codes()

static int iter_codes ( lua_State L)
static
Here is the call graph for this function:

◆ luaopen_utf8()

LUAMOD_API int luaopen_utf8 ( lua_State L)
Here is the call graph for this function:

◆ pushutfchar()

static void pushutfchar ( lua_State L,
int  arg 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ u_posrelat()

static lua_Integer u_posrelat ( lua_Integer  pos,
size_t  len 
)
static
Here is the caller graph for this function:

◆ utf8_decode()

static const char* utf8_decode ( const char *  o,
int *  val 
)
static
Here is the caller graph for this function:

◆ utfchar()

static int utfchar ( lua_State L)
static
Here is the call graph for this function:

◆ utflen()

static int utflen ( lua_State L)
static
Here is the call graph for this function:

Variable Documentation

◆ funcs

const luaL_Reg funcs[]
static
Initial value:
= {
{"offset", byteoffset},
{"codepoint", codepoint},
{"char", utfchar},
{"len", utflen},
{"codes", iter_codes},
{"charpattern", NULL},
}
static int codepoint(lua_State *L)
Definition: lutf8lib.c:100
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static int byteoffset(lua_State *L)
Definition: lutf8lib.c:160
static int iter_codes(lua_State *L)
Definition: lutf8lib.c:225
static int utflen(lua_State *L)
Definition: lutf8lib.c:71
static int utfchar(lua_State *L)
Definition: lutf8lib.c:138