Macros | Typedefs | 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:

Go to the source code of this file.

Macros

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

Typedefs

typedef unsigned long utfint
 

Functions

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

Variables

static const luaL_Reg funcs []
 

Macro Definition Documentation

◆ iscont

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

Definition at line 38 of file lutf8lib.c.

◆ LUA_LIB

#define LUA_LIB

Definition at line 8 of file lutf8lib.c.

◆ lutf8lib_c

#define lutf8lib_c

Definition at line 7 of file lutf8lib.c.

◆ MAXUNICODE

#define MAXUNICODE   0x10FFFFu

Definition at line 24 of file lutf8lib.c.

◆ MAXUTF

#define MAXUTF   0x7FFFFFFFu

Definition at line 26 of file lutf8lib.c.

◆ UTF8PATT

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

Definition at line 268 of file lutf8lib.c.

Typedef Documentation

◆ utfint

typedef unsigned long utfint

Definition at line 34 of file lutf8lib.c.

Function Documentation

◆ byteoffset()

static int byteoffset ( lua_State L)
static

Definition at line 183 of file lutf8lib.c.

◆ codepoint()

static int codepoint ( lua_State L)
static

Definition at line 122 of file lutf8lib.c.

◆ iter_aux()

static int iter_aux ( lua_State L,
int  strict 
)
static

Definition at line 224 of file lutf8lib.c.

◆ iter_auxlax()

static int iter_auxlax ( lua_State L)
static

Definition at line 252 of file lutf8lib.c.

◆ iter_auxstrict()

static int iter_auxstrict ( lua_State L)
static

Definition at line 248 of file lutf8lib.c.

◆ iter_codes()

static int iter_codes ( lua_State L)
static

Definition at line 257 of file lutf8lib.c.

◆ luaopen_utf8()

LUAMOD_API int luaopen_utf8 ( lua_State L)

Definition at line 283 of file lutf8lib.c.

◆ pushutfchar()

static void pushutfchar ( lua_State L,
int  arg 
)
static

Definition at line 151 of file lutf8lib.c.

◆ u_posrelat()

static lua_Integer u_posrelat ( lua_Integer  pos,
size_t  len 
)
static

Definition at line 43 of file lutf8lib.c.

◆ utf8_decode()

static const char* utf8_decode ( const char *  s,
utfint val,
int  strict 
)
static

Definition at line 57 of file lutf8lib.c.

◆ utfchar()

static int utfchar ( lua_State L)
static

Definition at line 161 of file lutf8lib.c.

◆ utflen()

static int utflen ( lua_State L)
static

Definition at line 92 of file lutf8lib.c.

Variable Documentation

◆ funcs

const luaL_Reg funcs[]
static
Initial value:
= {
{"offset", byteoffset},
{"codepoint", codepoint},
{"char", utfchar},
{"len", utflen},
{"codes", iter_codes},
{"charpattern", NULL},
{NULL, NULL}
}

Definition at line 271 of file lutf8lib.c.

iter_codes
static int iter_codes(lua_State *L)
Definition: lutf8lib.c:257
codepoint
static int codepoint(lua_State *L)
Definition: lutf8lib.c:122
utflen
static int utflen(lua_State *L)
Definition: lutf8lib.c:92
byteoffset
static int byteoffset(lua_State *L)
Definition: lutf8lib.c:183
utfchar
static int utfchar(lua_State *L)
Definition: lutf8lib.c:161


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49