Expand description
§yaslapi-sys
yaslapi-sys is a Rust library that provides raw bindings to the Yet Another Scripting Language (YASL) API.
Then run cargo build to build your project.
§Usage
Here’s an example of how to use yaslapi-sys in your Rust code:
use yaslapi_sys::YASL_State;
use std::ffi::CString;
const SRC: &str = "let x = 5; echo x**x;";
let state: *mut YASL_State = unsafe { yaslapi_sys::YASL_newstate_bb(SRC.as_ptr().cast(), SRC.len()) };
assert!(!state.is_null());
Structs§
- YASLX_
function - YASL_
State - __
atomic_ wide_ counter__ bindgen_ ty_ 1 - __
fsid_ t - __
once_ flag - __
pthread_ cond_ s - __
pthread_ internal_ list - __
pthread_ internal_ slist - __
pthread_ mutex_ s - __
pthread_ rwlock_ arch_ t - __
sigset_ t - div_t
- drand48_
data - fd_set
- imaxdiv_
t - ldiv_t
- lldiv_t
- random_
data - timespec
- timeval
Constants§
- BIG_
ENDIAN - BYTE_
ORDER - EXIT_
FAILURE - EXIT_
SUCCESS - FD_
SETSIZE - INT8_
MAX - INT8_
MIN - INT16_
MAX - INT16_
MIN - INT32_
MAX - INT32_
MIN - INTPTR_
MAX - INTPTR_
MIN - INT_
FAST8_ MAX - INT_
FAST8_ MIN - INT_
FAST16_ MAX - INT_
FAST16_ MIN - INT_
FAST32_ MAX - INT_
FAST32_ MIN - INT_
LEAS T8_ MAX - INT_
LEAS T8_ MIN - INT_
LEAS T16_ MAX - INT_
LEAS T16_ MIN - INT_
LEAS T32_ MAX - INT_
LEAS T32_ MIN - LITTLE_
ENDIAN - PDP_
ENDIAN - PRIX8
- PRIX16
- PRIX32
- PRIX64
- PRIXFAS
T8 - PRIXFAS
T16 - PRIXFAS
T32 - PRIXFAS
T64 - PRIXLEAS
T8 - PRIXLEAS
T16 - PRIXLEAS
T32 - PRIXLEAS
T64 - PRIXMAX
- PRIXPTR
- PRId8
- PRId16
- PRId32
- PRId64
- PRIdFAS
T8 - PRIdFAS
T16 - PRIdFAS
T32 - PRIdFAS
T64 - PRIdLEAS
T8 - PRIdLEAS
T16 - PRIdLEAS
T32 - PRIdLEAS
T64 - PRIdMAX
- PRIdPTR
- PRIi8
- PRIi16
- PRIi32
- PRIi64
- PRIiFAS
T8 - PRIiFAS
T16 - PRIiFAS
T32 - PRIiFAS
T64 - PRIiLEAS
T8 - PRIiLEAS
T16 - PRIiLEAS
T32 - PRIiLEAS
T64 - PRIiMAX
- PRIiPTR
- PRIo8
- PRIo16
- PRIo32
- PRIo64
- PRIoFAS
T8 - PRIoFAS
T16 - PRIoFAS
T32 - PRIoFAS
T64 - PRIoLEAS
T8 - PRIoLEAS
T16 - PRIoLEAS
T32 - PRIoLEAS
T64 - PRIoMAX
- PRIoPTR
- PRIu8
- PRIu16
- PRIu32
- PRIu64
- PRIuFAS
T8 - PRIuFAS
T16 - PRIuFAS
T32 - PRIuFAS
T64 - PRIuLEAS
T8 - PRIuLEAS
T16 - PRIuLEAS
T32 - PRIuLEAS
T64 - PRIuMAX
- PRIuPTR
- PRIx8
- PRIx16
- PRIx32
- PRIx64
- PRIxFAS
T8 - PRIxFAS
T16 - PRIxFAS
T32 - PRIxFAS
T64 - PRIxLEAS
T8 - PRIxLEAS
T16 - PRIxLEAS
T32 - PRIxLEAS
T64 - PRIxMAX
- PRIxPTR
- PTRDIFF_
MAX - PTRDIFF_
MIN - RAND_
MAX - SCNd8
- SCNd16
- SCNd32
- SCNd64
- SCNdFAS
T8 - SCNdFAS
T16 - SCNdFAS
T32 - SCNdFAS
T64 - SCNdLEAS
T8 - SCNdLEAS
T16 - SCNdLEAS
T32 - SCNdLEAS
T64 - SCNdMAX
- SCNdPTR
- SCNi8
- SCNi16
- SCNi32
- SCNi64
- SCNiFAS
T8 - SCNiFAS
T16 - SCNiFAS
T32 - SCNiFAS
T64 - SCNiLEAS
T8 - SCNiLEAS
T16 - SCNiLEAS
T32 - SCNiLEAS
T64 - SCNiMAX
- SCNiPTR
- SCNo8
- SCNo16
- SCNo32
- SCNo64
- SCNoFAS
T8 - SCNoFAS
T16 - SCNoFAS
T32 - SCNoFAS
T64 - SCNoLEAS
T8 - SCNoLEAS
T16 - SCNoLEAS
T32 - SCNoLEAS
T64 - SCNoMAX
- SCNoPTR
- SCNu8
- SCNu16
- SCNu32
- SCNu64
- SCNuFAS
T8 - SCNuFAS
T16 - SCNuFAS
T32 - SCNuFAS
T64 - SCNuLEAS
T8 - SCNuLEAS
T16 - SCNuLEAS
T32 - SCNuLEAS
T64 - SCNuMAX
- SCNuPTR
- SCNx8
- SCNx16
- SCNx32
- SCNx64
- SCNxFAS
T8 - SCNxFAS
T16 - SCNxFAS
T32 - SCNxFAS
T64 - SCNxLEAS
T8 - SCNxLEAS
T16 - SCNxLEAS
T32 - SCNxLEAS
T64 - SCNxMAX
- SCNxPTR
- SIG_
ATOMIC_ MAX - SIG_
ATOMIC_ MIN - SIZE_
MAX - STACK_
SIZE - UINT8_
MAX - UINT16_
MAX - UINT32_
MAX - UINTPTR_
MAX - UINT_
FAST8_ MAX - UINT_
FAST16_ MAX - UINT_
FAST32_ MAX - UINT_
LEAS T8_ MAX - UINT_
LEAS T16_ MAX - UINT_
LEAS T32_ MAX - WCONTINUED
- WEXITED
- WINT_
MAX - WINT_
MIN - WNOHANG
- WNOWAIT
- WSTOPPED
- WUNTRACED
- YASL_
DEFAULT_ CPATH - YASL_
DEFAULT_ PATH - YASL_
Error_ YASL_ ASSERT_ ERROR - YASL_
Error_ YASL_ DIVIDE_ BY_ ZERO_ ERROR - YASL_
Error_ YASL_ ERROR - YASL_
Error_ YASL_ INIT_ ERROR - YASL_
Error_ YASL_ MODULE_ SUCCESS - YASL_
Error_ YASL_ PLATFORM_ NOT_ SUPP - YASL_
Error_ YASL_ STACK_ OVERFLOW_ ERROR - YASL_
Error_ YASL_ SUCCESS - YASL_
Error_ YASL_ SYNTAX_ ERROR - YASL_
Error_ YASL_ TOO_ MANY_ VAR_ ERROR - YASL_
Error_ YASL_ TYPE_ ERROR - YASL_
Error_ YASL_ VALUE_ ERROR - YASL_
FLOAT_ NAME - YASL_
INT_ NAME - YASL_
PATH_ MARK - YASL_
PATH_ SEP - YASL_
STR_ NAME - YASL_
TABLE_ NAME - YASL_
Types_ Y_ BOOL - YASL_
Types_ Y_ CFN - YASL_
Types_ Y_ CLOSURE - YASL_
Types_ Y_ END - YASL_
Types_ Y_ FLOAT - YASL_
Types_ Y_ FN - YASL_
Types_ Y_ INT - YASL_
Types_ Y_ LIST - YASL_
Types_ Y_ STR - YASL_
Types_ Y_ TABLE - YASL_
Types_ Y_ UNDEF - YASL_
Types_ Y_ USERDATA - YASL_
Types_ Y_ USERPTR - YASL_
VERSION - _ALLOCA_
H - _ATFILE_
SOURCE - _BITS_
BYTESWAP_ H - _BITS_
ENDIANNESS_ H - _BITS_
ENDIAN_ H - _BITS_
PTHREADTYPES_ ARCH_ H - _BITS_
PTHREADTYPES_ COMMON_ H - _BITS_
STDINT_ INTN_ H - _BITS_
STDINT_ UINTN_ H - _BITS_
TIME64_ H - _BITS_
TYPESIZES_ H - _BITS_
TYPES_ H - _BITS_
UINTN_ IDENTITY_ H - _BITS_
WCHAR_ H - _DEFAULT_
SOURCE - _ENDIAN_
H - _FEATURES_
H - _INTTYPES_
H - _POSIX_
C_ SOURCE - _POSIX_
SOURCE - _STDC_
PREDEF_ H - _STDINT_
H - _STDLIB_
H - _STRUCT_
TIMESPEC - _SYS_
CDEFS_ H - _SYS_
SELECT_ H - _SYS_
TYPES_ H - _THREAD_
MUTEX_ INTERNAL_ H - _THREAD_
SHARED_ TYPES_ H - __
BIG_ ENDIAN - __
BIT_ TYPES_ DEFINED__ - __
BYTE_ ORDER - __
FD_ SETSIZE - __
FLOAT_ WORD_ ORDER - __
GLIBC_ MINOR__ - __
GLIBC_ USE_ DEPRECATED_ GETS - __
GLIBC_ USE_ DEPRECATED_ SCANF - __
GLIBC_ USE_ IEC_ 60559_ BFP_ EXT - __
GLIBC_ USE_ IEC_ 60559_ BFP_ EXT_ C2X - __
GLIBC_ USE_ IEC_ 60559_ EXT - __
GLIBC_ USE_ IEC_ 60559_ FUNCS_ EXT - __
GLIBC_ USE_ IEC_ 60559_ FUNCS_ EXT_ C2X - __
GLIBC_ USE_ IEC_ 60559_ TYPES_ EXT - __
GLIBC_ USE_ ISOC2X - __
GLIBC_ USE_ LIB_ EXT2 - __
GLIBC__ - __
GNU_ LIBRARY__ - __
HAVE_ DISTINCT_ FLOA T16 - __
HAVE_ DISTINCT_ FLOA T32 - __
HAVE_ DISTINCT_ FLOA T64 - __
HAVE_ DISTINCT_ FLOA T32X - __
HAVE_ DISTINCT_ FLOA T64X - __
HAVE_ DISTINCT_ FLOA T128 - __
HAVE_ DISTINCT_ FLOA T128X - __
HAVE_ FLOA T16 - __
HAVE_ FLOA T32 - __
HAVE_ FLOA T64 - __
HAVE_ FLOA T32X - __
HAVE_ FLOA T64X - __
HAVE_ FLOA T64X_ LONG_ DOUBLE - __
HAVE_ FLOA T128 - __
HAVE_ FLOA T128X - __
HAVE_ FLOATN_ NOT_ TYPEDEF - __
HAVE_ GENERIC_ SELECTION - __
INO_ T_ MATCHES_ INO64_ T - __
KERNEL_ OLD_ TIMEVAL_ MATCHES_ TIMEVA L64 - __
LDOUBLE_ REDIRECTS_ TO_ FLOA T128_ ABI - __
LITTLE_ ENDIAN - __
OFF_ T_ MATCHES_ OFF64_ T - __
PDP_ ENDIAN - __
PRI64_ PREFIX - __
PRIPTR_ PREFIX - __
PTHREAD_ MUTEX_ HAVE_ PREV - __
RLIM_ T_ MATCHES_ RLIM64_ T - __
SIZEOF_ PTHREAD_ ATTR_ T - __
SIZEOF_ PTHREAD_ BARRIERATTR_ T - __
SIZEOF_ PTHREAD_ BARRIER_ T - __
SIZEOF_ PTHREAD_ CONDATTR_ T - __
SIZEOF_ PTHREAD_ COND_ T - __
SIZEOF_ PTHREAD_ MUTEXATTR_ T - __
SIZEOF_ PTHREAD_ MUTEX_ T - __
SIZEOF_ PTHREAD_ RWLOCKATTR_ T - __
SIZEOF_ PTHREAD_ RWLOCK_ T - __
STATFS_ MATCHES_ STATF S64 - __
STDC_ IEC_ 559_ COMPLEX__ - __
STDC_ IEC_ 559__ - __
STDC_ IEC_ 60559_ BFP__ - __
STDC_ IEC_ 60559_ COMPLEX__ - __
STDC_ ISO_ 10646__ - __
SYSCALL_ WORDSIZE - __
TIMESIZE - __
USE_ ATFILE - __
USE_ FORTIFY_ LEVEL - __
USE_ ISOC11 - __
USE_ ISOC95 - __
USE_ ISOC99 - __
USE_ MISC - __
USE_ POSIX - __
USE_ POSI X2 - __
USE_ POSI X199309 - __
USE_ POSI X199506 - __
USE_ POSIX_ IMPLICITLY - __
USE_ XOPE N2K - __
USE_ XOPE N2K8 - __WALL
- __
WCLONE - __
WCOREFLAG - __
WNOTHREAD - __
WORDSIZE - __
WORDSIZE_ TIME64_ COMPA T32 - __
W_ CONTINUED - ____
gwchar_ t_ defined - __
bool_ true_ false_ are_ defined - __
clock_ t_ defined - __
clockid_ t_ defined - __
glibc_ c99_ flexarr_ available - __
have_ pthread_ attr_ t - __
ldiv_ t_ defined - __
lldiv_ t_ defined - __
sigset_ t_ defined - __
time_ t_ defined - __
timer_ t_ defined - __
timeval_ defined - false_
- true_
Statics§
Functions§
- YASLX_
checknbool ⚠ - Returns the nth position of the stack if it is a bool. Otherwise, causes a type error, along with a printed error message. @param S The YASL_State. @param name Name of the function in which this is called, used for error message. @param pos the position of the argument. @return the nth position of the stack if it’s a bool, otherwise no return.
- YASLX_
checknfloat ⚠ - Returns the nth position of the stack if it is a float. Otherwise, causes a type error, along with a printed error message. @param S The YASL_State. @param name Name of the function in which this is called, used for error message. @param pos the position of the argument. @return the nth position of the stack if it’s a float, otherwise no return.
- YASLX_
checknint ⚠ - Returns the nth position of the stack if it is an int. Otherwise, causes a type error, along with a printed error message. @param S The YASL_State. @param name Name of the function in which this is called, used for error message. @param pos the position of the argument. @return the nth position of the stack if it’s an int, otherwise no return.
- YASLX_
checknundef ⚠ - Checks that the nth position of the stack if it is undef. Otherwise, causes a type error, along with a printed error message. @param S The YASL_State. @param name Name of the function in which this is called, used for error message. @param pos the position of the argument.
- YASLX_
checknuserdata ⚠ - Returns the nth position of the stack if it is a userdata with a matching tag. Otherwise, causes a type error, along with a printed error message. @param S The YASL_State. @param tag The tag of the userdata. @param name Name of the function in which this is called, used for error message. @param pos the position of the argument, used only for the error message. @return the nth position of the stack if it’s a userdata, otherwise no return.
- YASLX_
decllibs ⚠ - Loads all standard libraries into the appropriate state and declares them all with their default names. @param S The state onto which to load the libraries. @return YASL_SUCESS on success, else error code.
- YASLX_
initglobal ⚠ - Declares a global and initializes it with the top value from the stack. @param S the YASL_State. @param name name of the global (nul-terminated). @return
- YASLX_
print_ ⚠err_ bad_ arg_ type - Prints an error message @param S The YASL State. @param fn_name name of the function in which the error occured. @param position which arg had the wrong type. @param exp expected type of the arg. @param act actual type of the arg.
- YASLX_
tablesetfunctions ⚠ - Inserts all functions in the array into a table on top of the stack. @param S The YASL_State @param functions array of function names, function pointers, and number of args.
- YASL_
compile ⚠ - [-0, +0] compiles the source for the given YASL_State, but doesn’t run it. @param S the YASL_State containing the YASL source code to be compiled. @return 0 on success, otherwise an error code.
- YASL_
declglobal ⚠ - [-0, +0] Declares a global for use in the given YASL_State. YASL does not handle the lifetime of the string; normally a literal is used. @param S the YASL_State in which to declare the global. @param name the name of the global (null-terminated string). @return YASL_SUCCESS on success, otherwise an error code.
- YASL_
decllib_ ⚠collections - YASL_
decllib_ ⚠error - YASL_
decllib_ ⚠io - YASL_
decllib_ ⚠math - YASL_
decllib_ ⚠mt - YASL_
decllib_ ⚠os - YASL_
decllib_ ⚠require - YASL_
decllib_ ⚠require_ c - YASL_
delstate ⚠ - deletes the given YASL_State. @param S YASL_State to be deleted. @return 0 on success, otherwise an error code.
- YASL_
duptop ⚠ - [-0, +1] Duplicates the top of the stack. @param S the YASL_State. @return YASL_SUCCESS on success, otherwise an error code.
- YASL_
execute ⚠ - [-0, +0] Execute the bytecode for the given YASL_State. @param S the YASL_State to use to execute the bytecode. @return 0 on successful execution, else an error code.
- YASL_
execute_ ⚠REPL - [-0, +0] Execute the bytecode for the given YASL_State in REPL mode. The only difference between YASL_execute_REPL and YASL_execute is that YASL_execute_REPL will print the last statement passed to it if that statement is an expression. @param S the YASL_State to use to execute the bytecode. @return 0 on successful execution, else an error code.
- YASL_
functioncall ⚠ - [-(n+1), +r] Calls a function with n parameters. The function should be located below all n parameters it will be called with. The left-most parameter is placed directly above the function, the right-most paramter at the top of the stack. @param S the YASL_State @param n @return r, the number of return values of the called functions
- YASL_
isbool ⚠ - [-0, +0] checks if the top of the stack is bool. @param S the YASL_State. @return true if the top of the stack is bool, else false.
- YASL_
isfloat ⚠ - [-0, +0] checks if the top of the stack is float. @param S the YASL_State. @return true if the top of the stack is float, else false.
- YASL_
isint ⚠ - [-0, +0] checks if the top of the stack is int. @param S the YASL_State. @return true if the top of the stack is int, else false.
- YASL_
islist ⚠ - [-0, +0] checks if the top of the stack is list. @param S the YASL_State. @return true if the top of the stack is list, else false.
- YASL_
isnbool ⚠ - [-0, +0] checks if the object at index n is bool. @param S the YASL_State. @return true if the object at index n is bool, else false.
- YASL_
isnfloat ⚠ - [-0, +0] checks if the object at index n is float. @param S the YASL_State. @return true if the object at index n is float, else false.
- YASL_
isnint ⚠ - [-0, +0] checks if the object at index n is int. @param S the YASL_State. @return true if the object at index n is int, else false.
- YASL_
isnlist ⚠ - [-0, +0] checks if the object at index n is list. @param S the YASL_State. @return true if the object at index n is list, else false.
- YASL_
isnstr ⚠ - [-0, +0] checks if the object at index n is str. @param S the YASL_State to which the stack belongs. @return true if the object at index n is str, else false.
- YASL_
isntable ⚠ - [-0, +0] checks if the object at index n is table. @param S the YASL_State to which the stack belongs. @return true if the object at index n is table, else false.
- YASL_
isnundef ⚠ - [-0, +0] Checks if the object at index n is undef. @param S the YASL_State to which the stack belongs. @return true if the object at index n is undef, else false.
- YASL_
isnuserdata ⚠ - [-0, +0] checks if the object at index n is userdata. @param S the YASL_State. @return true if the object at index n is userdata, else false.
- YASL_
isnuserptr ⚠ - [-0, +0] checks if the object at index n is userpointer. @param S the YASL_State. @return true if the object at index n is userpointer, else false.
- YASL_
isstr ⚠ - [-0, +0] checks if the top of the stack is str. @param S the YASL_State. @return true if the top of the stack is str, else false.
- YASL_
istable ⚠ - [-0, +0] checks if the top of the stack is table. @param S the YASL_State. @return true if the top of the stack is table, else false.
- YASL_
isundef ⚠ - [-0, +0] Checks if the top of the stack is undef. @param S the YASL_State. @return true if the top of the stack is undef, else false.
- YASL_
isuserdata ⚠ - [-0, +0] checks if the top of the stack is userdata. @param S the YASL_State. @return true if the top of the stack is userdata, else false.
- YASL_
isuserptr ⚠ - [-0, +0] checks if the top of the stack is userpointer. @param S the YASL_State. @return true if the top of the stack is userpointer, else false.
- YASL_
len ⚠ - [+1, -1]
Pops the top of the stack, the evalutes
len x
, wherex
is the popped value. The result is pushed on top of the stack. @param S the YASL_State. - YASL_
listget ⚠ - [+1, -0] Indexes the list on top of the stack and pushes the result on top of the stack. @param S the YASL_State. @param n the index to use on the list. @return YASL_SUCCESS on
- YASL_
listpush ⚠ - [-1, +0] Pops the top of the stack and appends it to a list (which should be located directly below the top of the stack). @param S the YASL_State. @return YASL_SUCCESS on sucess, else an error code.
- YASL_
loadglobal ⚠ - [-0, +1] Loads a global and puts it on top of the stack. @param S the YASL_State. @param name nul-terminated name of the global. @return YASL_SUCCESS on success, otherwise an error code.
- YASL_
loadmt ⚠ - [-0, +1] Loads a metatable by name. @param S the YASL_State. @param name name of the metatable. @return YASL_SUCCESS on success, else an error code.
- YASL_
loadprinterr ⚠ - YASL_
loadprintout ⚠ - YASL_
newstate ⚠ - Initialises a new YASL_State for usage. @param filename the name of the file used to initialize the state. @return the new YASL_State, or NULL on failure.
- YASL_
newstate_ ⚠bb - initialises a new YASL_State for usage, or NULL on failure. @param buf buffer containing the source code used to initialize the state. @param len the length of the buffer. @return the new YASL_State
- YASL_
peekbool ⚠ - [-0, +0] Returns the bool value of the top of the stack, if it is a boolean. Otherwise returns false. Does not modify the stack. @param S the YASL_State. @return
- YASL_
peekcstr ⚠ - [-0, +0] Returns a copy of the str value of the top of the stack, if the top of the stack is a str. Otherwise returns 0. Does not modify the stack. @param S the YASL_State. @return the value of the str on top of the stack, or NULL if it’s not a str.
- YASL_
peekfloat ⚠ - [-0, +0] Returns the float value of the top of the stack, if the top of the stack is a float. Otherwise returns 0.0. Does not modify the stack. @param S the YASL_State. @return
- YASL_
peekint ⚠ - [-0, +0] Returns the int value of the top of the stack, if the top of the stack is an int. Otherwise returns 0. Does not modify the stack. @param S the YASL_State. @return the value of the int on top of the stack, or 0 if it’s not an int.
- YASL_
peeknbool ⚠ - [-0, +0] Returns the bool value at index n, if it is a boolean. Otherwise returns false. Does not modify the stack. @param S @return
- YASL_
peeknfloat ⚠ - [-0, +0] Returns the float value at index n, if it is a float. Otherwise returns 0.0. Does not modify the stack. @param S @return
- YASL_
peeknint ⚠ - [-0, +0] Returns the int value at index n, if it is an int. Otherwise returns 0. Does not modify the stack. @param S the YASL_State. @return the value of the int at index n, or 0 if it’s not an int.
- YASL_
peekntype ⚠ - [-0, +0] returns the type of object at index n. @param S the YASL_State. @return the type on top of the stack.
- YASL_
peekntypename ⚠ - [-0, +0] returns the type of index n as a string. @param S the YASL_State. @return the string representation of the type of index n.
- YASL_
peeknuserdata ⚠ - [-0, +0] Returns the userdata value at index n, if it is a userdata. Otherwise returns NULL. Does not modify the stack. @param S the YASL_State. @return the userdata value at index n, or NULL if it’s not a userdata.
- YASL_
peektype ⚠ - [-0, +0] returns the type of the top of the stack. @param S the YASL_State. @return the type on top of the stack.
- YASL_
peektypename ⚠ - [-0, +0] returns the type of the top of the stack as a string. @param S the YASL_State to which the stack belongs. @return the string representation of the type on top of the stack.
- YASL_
peekuserdata ⚠ - [-0, +0] Returns the userdata value of the top of the stack, if the top of the stack is a userdata. Otherwise returns NULL. Does not modify the stack. @param S the YASL_State. @return the userdata value on top of the stack, or NULL if it’s not a userdata.
- YASL_
peekuserptr ⚠ - [-0, +0] Returns the userptr value of the top of the stack, if the top of the stack is a userptr. Otherwise returns NULL. Does not modify the stack. @param S the YASL_State. @return the value of the userptr on top of the stack, or NULL if it’s not a userptr.
- YASL_
peekvargscount ⚠ - YASL_
pop ⚠ - [-1, +0] Removes the top of the stack. @param S the YASL_State the stack belongs to.
- YASL_
popbool ⚠ - [-1, +0] Returns the bool value of the top of the stack, if the top of the stack is a boolean. Otherwise returns false. Removes the top element of the stack. @param S the YASL_State. @return the bool value of the top of the stack.
- YASL_
popcstr ⚠ - [-1, +0] Returns the str value (nul-terminated) of the top of the stack, if the top of the stack is a str. Otherwise returns NULL. @param S the YASL_State. @return the value of the str on top of the stack, or NULL if it’s not a str.
- YASL_
popfloat ⚠ - [-1, +0] Returns the float value of the top of the stack, if the top of the stack is a float. Otherwise returns 0.0. Removes the top of the stack. @param S the YASL_State. @return the float value on top of the stack.
- YASL_
popint ⚠ - [-1, +0] Returns the int value of the top of the stack, if the top of the stack is an int. Otherwise returns 0. Removes the top of the stack. @param S the YASL_State. @return the int value of the top of the stack.
- YASL_
popuserdata ⚠ - YASL_
popuserptr ⚠ - YASL_
print_ ⚠err - [-0, +0] Prints a runtime error. @param S the YASL_State in which the error occurred. @param fmt a format string, taking the same parameters as printf. @param … var args for the above format strings.
- YASL_
pushbool ⚠ - [-0, +1] Pushes a boolean value onto the stack. @param S the YASL_State onto which to push the boolean. @param value boolean to be pushed onto the stack.
- YASL_
pushcfunction ⚠ - [-0, +1] Pushes a function pointer onto the stack @param S the YASL_State onto which to push the string. @param value the function pointer to be pushed onto the stack.
- YASL_
pushfloat ⚠ - [-0, +1] Pushes a double value onto the stack. @param S the YASL_State onto which to push the double. @param value the float to push onto the stack.
- YASL_
pushint ⚠ - [-0, +1] Pushes an integer value onto the stack. @param S the YASL_State onto which to push the integer. @param integer to be pushed onto the stack.
- YASL_
pushlist ⚠ - [-0, +1] Pushes an empty list onto the stack. @param S the YASL_State onto which to push the list.
- YASL_
pushlit ⚠ - [-0, +1] Pushes a nul-terminated string onto the stack. This memory will not be managed by YASL, and must outlive S. @param S the YASL_State. @param value nul-terminated string to be pushed onto the stack.
- YASL_
pushlstr ⚠ - [-0, +1] Pushes a string with length len onto the stack. YASL makes a copy of the given string, and manages the memory for it. The string may have embedded 0s. @param S the YASL_State. @param value the string to be pushed onto the stack. @param len the length of value.
- YASL_
pushtable ⚠ - [-0, +1] Pushes an empty table onto the stack. @param S the YASL_State onto which to push the table.
- YASL_
pushundef ⚠ - [-0, +1] Pushes an undef value onto the stack. @param S the YASL_State onto which to push the undef.
- YASL_
pushuserdata ⚠ - [-0, +1] Pushes a user-pointer onto the stack @param S the YASL_State onto which to push the user-pointer. @param userpointer the user-pointer to push onto the stack.
- YASL_
pushuserptr ⚠ - [-0, +1] Pushes a user-pointer onto the stack @param S the YASL_State onto which to push the user-pointer. @param userpointer the user-pointer to push onto the stack.
- YASL_
pushzstr ⚠ - Pushes a nul-terminated string onto the stack. YASL makes a copy of the given string, and manages the memory for it. The string may not have embedded 0s; it is assumed to end at the first 0. @param S the YASL_State. @param value the string to be pushed onto the stack (nul-terminated).
- YASL_
registermt ⚠ - [-0, +0]
Registers a metatable with name
name
. After this returns, the metatable can be referred to byname
in other functions dealing with metatables, e.g.YASL_setmt
orYASL_loadmt
. @param S the YASL_State. @param name the name of the metatable. @return YASL_SUCCESS. - YASL_
resetstate ⚠ - resets S to the same state it would be in if newly created using YASL_newstate. @param S the YASL_State @param filename the name of the file used to initialize S @return YASL_SUCCESS if successful, otherwise an error.
- YASL_
resetstate_ ⚠bb - resets S to the same state it would be in if newly created using YASL_newstate_bb. @param S the YASL_State. @param buf the buffer used to initialize S. @param len the length of buf. @return YASL_SUCCESS on success, else an error code.
- YASL_
setglobal ⚠ - [-1, +0] Pops the top of the YASL stack and stores it in the given global. @param S the YASL_State in which to store the global. @param name the name of the global. @return YASL_SUCCESS on success, otherwise an error code.
- YASL_
setmt ⚠ - YASL_
setprinterr_ ⚠tostr - YASL_
setprintout_ ⚠tostr - YASL_
stringifytop ⚠ - YASL_
tablenext ⚠ - [-1, +2] Iterates over a table. The topmost item of the stack should be the previous index in the table, followed by the table itself. The index is popped, and then if there are more elements in the table, the next index and value are pushed. No values are pushed if we are already at the end of the table. @param S the YASL_State. @return true if there was a next element, otherwise false.
- YASL_
tableset ⚠ - [-2, +0] inserts a key-value pair into the table. The topmost items is value, then key, then table. The key and value are popped from the stack. @param S the YASL_State which has the 3 items on top of the stack. @return 0 on success, else error code
- YASL_
throw_ ⚠err - [-0, +0] Causes a fatal error. @param S the YASL_State in which the error occured. @param error the error code.
- _Exit⚠
- __
ctype_ ⚠get_ mb_ cur_ max - a64l⚠
- abort⚠
- abs⚠
- aligned_
alloc ⚠ - alloca⚠
- at_
quick_ ⚠exit - atexit⚠
- atof⚠
- atoi⚠
- atol⚠
- atoll⚠
- bsearch⚠
- calloc⚠
- clearenv⚠
- div⚠
- drand48⚠
- drand48_
r ⚠ - ecvt⚠
- ecvt_r⚠
- erand48⚠
- erand48_
r ⚠ - exit⚠
- fcvt⚠
- fcvt_r⚠
- free⚠
- gcvt⚠
- getenv⚠
- getloadavg⚠
- getsubopt⚠
- imaxabs⚠
- imaxdiv⚠
- initstate⚠
- initstate_
r ⚠ - jrand48⚠
- jrand48_
r ⚠ - l64a⚠
- labs⚠
- lcong48⚠
- lcong48_
r ⚠ - ldiv⚠
- llabs⚠
- lldiv⚠
- lrand48⚠
- lrand48_
r ⚠ - malloc⚠
- mblen⚠
- mbstowcs⚠
- mbtowc⚠
- mkdtemp⚠
- mkstemp⚠
- mkstemps⚠
- mktemp⚠
- mrand48⚠
- mrand48_
r ⚠ - nrand48⚠
- nrand48_
r ⚠ - on_exit⚠
- posix_
memalign ⚠ - pselect⚠
- putenv⚠
- qecvt⚠
- qecvt_r⚠
- qfcvt⚠
- qfcvt_r⚠
- qgcvt⚠
- qsort⚠
- quick_
exit ⚠ - rand⚠
- rand_r⚠
- random⚠
- random_
r ⚠ - realloc⚠
- reallocarray⚠
- realpath⚠
- rpmatch⚠
- seed48⚠
- seed48_
r ⚠ - select⚠
- setenv⚠
- setstate⚠
- setstate_
r ⚠ - srand⚠
- srand48⚠
- srand48_
r ⚠ - srandom⚠
- srandom_
r ⚠ - strtod⚠
- strtof⚠
- strtoimax⚠
- strtol⚠
- strtold⚠
- strtoll⚠
- strtoq⚠
- strtoul⚠
- strtoull⚠
- strtoumax⚠
- strtouq⚠
- system⚠
- unsetenv⚠
- valloc⚠
- wcstoimax⚠
- wcstombs⚠
- wcstoumax⚠
- wctomb⚠
Type Aliases§
- YASL_
Error - YASL_
Types - YASL_
cfn - Typedef for YASL functions defined through the C API.
- _Float32
- _Float64
- _Float32x
- _Float64x
- __
blkcnt64_ t - __
blkcnt_ t - __
blksize_ t - __
caddr_ t - __
clock_ t - __
clockid_ t - __
compar_ fn_ t - __
daddr_ t - __dev_t
- __
fd_ mask - __
fsblkcnt64_ t - __
fsblkcnt_ t - __
fsfilcnt64_ t - __
fsfilcnt_ t - __
fsword_ t - __gid_t
- __
gwchar_ t - __id_t
- __
ino64_ t - __ino_t
- __
int8_ t - __
int16_ t - __
int32_ t - __
int64_ t - __
int_ least8_ t - __
int_ least16_ t - __
int_ least32_ t - __
int_ least64_ t - __
intmax_ t - __
intptr_ t - __key_t
- __
loff_ t - __
mode_ t - __
nlink_ t - __
off64_ t - __off_t
- __pid_t
- __
pthread_ list_ t - __
pthread_ slist_ t - __
quad_ t - __
rlim64_ t - __
rlim_ t - __
sig_ atomic_ t - __
socklen_ t - __
ssize_ t - __
suseconds64_ t - __
suseconds_ t - __
syscall_ slong_ t - __
syscall_ ulong_ t - __
thrd_ t - __
time_ t - __
timer_ t - __tss_t
- __
u_ char - __u_int
- __
u_ long - __
u_ quad_ t - __
u_ short - __uid_t
- __
uint8_ t - __
uint16_ t - __
uint32_ t - __
uint64_ t - __
uint_ least8_ t - __
uint_ least16_ t - __
uint_ least32_ t - __
uint_ least64_ t - __
uintmax_ t - __
useconds_ t - blkcnt_
t - blksize_
t - caddr_t
- clock_t
- clockid_
t - daddr_t
- dev_t
- fd_mask
- fsblkcnt_
t - fsfilcnt_
t - fsid_t
- gid_t
- id_t
- ino_t
- int_
fast8_ t - int_
fast16_ t - int_
fast32_ t - int_
fast64_ t - int_
least8_ t - int_
least16_ t - int_
least32_ t - int_
least64_ t - intmax_
t - key_t
- loff_t
- mode_t
- nlink_t
- off_t
- pid_t
- pthread_
key_ t - pthread_
once_ t - pthread_
spinlock_ t - pthread_
t - quad_t
- register_
t - sigset_
t - suseconds_
t - time_t
- timer_t
- u_char
- u_int
- u_
int8_ t - u_
int16_ t - u_
int32_ t - u_
int64_ t - u_long
- u_
quad_ t - u_short
- uid_t
- uint
- uint_
fast8_ t - uint_
fast16_ t - uint_
fast32_ t - uint_
fast64_ t - uint_
least8_ t - uint_
least16_ t - uint_
least32_ t - uint_
least64_ t - uintmax_
t - ulong
- ushort
- wchar_t