A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 40 lines 1.5 kB view raw
1/* 2** $Id$ 3** String table (keep all strings handled by Lua) 4** See Copyright Notice in lua.h 5*/ 6 7#ifndef lstring_h 8#define lstring_h 9 10 11#include "lgc.h" 12#include "lobject.h" 13#include "lstate.h" 14 15/* ROCKLUA ADDED */ 16#define TSTR_INBLOB 0 /* string will be allocated at end of tstring struct */ 17#define TSTR_INBIN 1 /* string is static within binary, pointer stored */ 18#define TSTR_FIXED 2 /* string won't be collected for duration of L state */ 19#define TSTR_CHKSZ 4 /* luaS_newllocstr shall determine size of string */ 20#define TSTR_ISLIT 8 | TSTR_INBIN /* literal string static within binary */ 21#define sizetstring(t, l) (sizeof(union TString) + (testbits((t), TSTR_INBIN) ? \ 22 sizeof(const char **) : ((l)+1)*sizeof(char))) 23 24#define sizeudata(u) (sizeof(union Udata)+(u)->len) 25 26#define luaS_new(L, s) (luaS_newllocstr(L, s, 0, TSTR_INBLOB | TSTR_CHKSZ)) 27#define luaS_newlstr(L, s, len) (luaS_newllocstr(L, s, len, TSTR_INBLOB)) 28#define luaS_newlloc(L, s, t) (luaS_newllocstr(L, s, 0, ((t) | TSTR_CHKSZ))) 29#define luaS_newliteral(L, s) (luaS_newllocstr(L, "" s, \ 30 (sizeof(s)/sizeof(char))-1, TSTR_ISLIT)) 31 32#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) 33 34LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 35LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); 36/* ROCKLUA ADDED */ 37LUAI_FUNC TString *luaS_newllocstr (lua_State *L, 38 const char *str, size_t l, char type); 39 40#endif