libgpac
Documentation of the core library of GPAC
quickjs-libc.c File Reference
#include <gpac/tools.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <inttypes.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <sys/time.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <time.h>
#include <signal.h>
#include <limits.h>
#include <sys/stat.h>
#include <dlfcn.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <gpac/thread.h>
#include <stdatomic.h>
#include "cutils.h"
#include "list.h"
#include "quickjs-libc.h"
+ Include dependency graph for quickjs-libc.c:

Data Structures

struct  JSOSRWHandler
 
struct  JSOSSignalHandler
 
struct  JSOSTimer
 
struct  JSWorkerMessage
 
struct  JSWorkerMessagePipe
 
struct  JSWorkerMessageHandler
 
struct  JSThreadState
 
struct  JSSTDFile
 
struct  JSWorkerData
 
struct  WorkerFuncArgs
 
struct  JSSABHeader
 

Macros

#define USE_WORKER
 
#define URL_GET_PROGRAM   "curl -s -i"
 
#define URL_GET_BUF_SIZE   4096
 
#define DEF(x)   JS_PROP_INT32_DEF(#x, x, JS_PROP_CONFIGURABLE )
 
#define OS_PLATFORM   "linux"
 
#define OS_FLAG(x)   JS_PROP_INT32_DEF(#x, x, JS_PROP_CONFIGURABLE )
 

Typedefs

typedef void(* mysighandler_t) (int sig_num)
 
typedef JSModuleDef *() JSInitModuleFunc(JSContext *ctx, const char *module_name)
 

Functions

static void js_std_dbuf_init (JSContext *ctx, DynBuf *s)
 
static BOOL my_isdigit (int c)
 
static JSValue js_printf_internal (JSContext *ctx, int argc, JSValueConst *argv, FILE *fp)
 
uint8_tjs_load_file (JSContext *ctx, size_t *pbuf_len, const char *filename)
 
static JSValue js_loadScript (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_loadFile (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSModuleDefjs_module_loader_so (JSContext *ctx, const char *module_name)
 
int js_module_set_import_meta (JSContext *ctx, JSValueConst func_val, JS_BOOL use_realpath, JS_BOOL is_main)
 
JSModuleDefjs_module_loader (JSContext *ctx, const char *module_name, void *opaque)
 
static JSValue js_std_exit (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_getenv (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_setenv (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_unsetenv (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_getenviron (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_gc (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int interrupt_handler (JSRuntime *rt, void *opaque)
 
static int get_bool_option (JSContext *ctx, BOOL *pbool, JSValueConst obj, const char *option)
 
static JSValue js_evalScript (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static void js_std_file_finalizer (JSRuntime *rt, JSValue val)
 
static ssize_t js_get_errno (ssize_t ret)
 
static JSValue js_std_strerror (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_parseExtJSON (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_new_std_file (JSContext *ctx, FILE *f, BOOL close_in_finalizer, BOOL is_popen)
 
static void js_set_error_object (JSContext *ctx, JSValue obj, int err)
 
static JSValue js_std_open (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_popen (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_fdopen (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_tmpfile (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_sprintf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_printf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static FILE * js_std_file_get (JSContext *ctx, JSValueConst obj)
 
static JSValue js_std_file_puts (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_std_file_close (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_printf (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_flush (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_tell (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int is_bigint)
 
static JSValue js_std_file_seek (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_eof (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_error (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_clearerr (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_fileno (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_read_write (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_std_file_getline (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_readAsString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_getByte (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_std_file_putByte (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int http_get_header_line (FILE *f, char *buf, size_t buf_size, DynBuf *dbuf)
 
static int http_get_status (const char *buf)
 
static JSValue js_std_urlGet (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int js_std_init (JSContext *ctx, JSModuleDef *m)
 
JSModuleDefjs_init_module_std (JSContext *ctx, const char *module_name)
 
static JSValue js_os_open (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_close (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_seek (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_read_write (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSValue js_os_isatty (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_ttyGetWinSize (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static void term_exit (void)
 
static JSValue js_os_ttySetRaw (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_remove (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_rename (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static BOOL is_main_thread (JSRuntime *rt)
 
static JSOSRWHandlerfind_rh (JSThreadState *ts, int fd)
 
static void free_rw_handler (JSRuntime *rt, JSOSRWHandler *rh)
 
static JSValue js_os_setReadHandler (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
 
static JSOSSignalHandlerfind_sh (JSThreadState *ts, int sig_num)
 
static void free_sh (JSRuntime *rt, JSOSSignalHandler *sh)
 
static void os_signal_handler (int sig_num)
 
static JSValue js_os_signal (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int64_t get_time_ms (void)
 
static void unlink_timer (JSRuntime *rt, JSOSTimer *th)
 
static void free_timer (JSRuntime *rt, JSOSTimer *th)
 
static void js_os_timer_finalizer (JSRuntime *rt, JSValue val)
 
static void js_os_timer_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_os_setTimeout (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_clearTimeout (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static void call_handler (JSContext *ctx, JSValueConst func)
 
static void js_free_message (JSWorkerMessage *msg)
 
static int handle_posted_message (JSRuntime *rt, JSContext *ctx, JSWorkerMessageHandler *port)
 
static int js_os_poll (JSContext *ctx)
 
static JSValue make_obj_error (JSContext *ctx, JSValue obj, int err)
 
static JSValue make_string_error (JSContext *ctx, const char *buf, int err)
 
static JSValue js_os_getcwd (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_chdir (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_mkdir (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_readdir (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int64_t timespec_to_ms (const struct timespec *tv)
 
static JSValue js_os_stat (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int is_lstat)
 
static void ms_to_timeval (struct timeval *tv, uint64_t v)
 
static JSValue js_os_utimes (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_sleep (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_realpath (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_symlink (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_readlink (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static char ** build_envp (JSContext *ctx, JSValueConst obj)
 
static int my_execvpe (const char *filename, char **argv, char **envp)
 
static JSValue js_os_exec (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_waitpid (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_kill (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_pipe (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_dup (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_os_dup2 (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int atomic_add_int (int *ptr, int v)
 
static void * js_sab_alloc (void *opaque, size_t size)
 
static void js_sab_free (void *opaque, void *ptr)
 
static void js_sab_dup (void *opaque, void *ptr)
 
static JSWorkerMessagePipejs_new_message_pipe (void)
 
static JSWorkerMessagePipejs_dup_message_pipe (JSWorkerMessagePipe *ps)
 
static void js_free_message_pipe (JSWorkerMessagePipe *ps)
 
static void js_free_port (JSRuntime *rt, JSWorkerMessageHandler *port)
 
static void js_worker_finalizer (JSRuntime *rt, JSValue val)
 
static void js_std_free_handlers_ex (JSRuntime *rt, int no_free_ts)
 
static unsigned int worker_func (void *opaque)
 
static JSValue js_worker_ctor_internal (JSContext *ctx, JSValueConst new_target, JSWorkerMessagePipe *recv_pipe, JSWorkerMessagePipe *send_pipe)
 
static JSValue js_worker_ctor (JSContext *ctx, JSValueConst new_target, int argc, JSValueConst *argv)
 
static JSValue js_worker_postMessage (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_worker_set_onmessage (JSContext *ctx, JSValueConst this_val, JSValueConst func)
 
static JSValue js_worker_get_onmessage (JSContext *ctx, JSValueConst this_val)
 
void js_std_set_worker_new_context_func (JSContext *(*func)(JSRuntime *rt))
 
static int js_os_init (JSContext *ctx, JSModuleDef *m)
 
JSModuleDefjs_init_module_os (JSContext *ctx, const char *module_name)
 
static JSValue js_print (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
void js_std_add_helpers (JSContext *ctx, int argc, char **argv)
 
void js_std_init_handlers (JSRuntime *rt)
 
void js_std_free_handlers (JSRuntime *rt)
 
static void js_dump_obj (JSContext *ctx, FILE *f, JSValueConst val)
 
static void js_std_dump_error1 (JSContext *ctx, JSValueConst exception_val)
 
void js_std_dump_error (JSContext *ctx)
 
void js_std_promise_rejection_tracker (JSContext *ctx, JSValueConst promise, JSValueConst reason, BOOL is_handled, void *opaque)
 
void js_std_loop (JSContext *ctx)
 
void js_std_eval_binary (JSContext *ctx, const uint8_t *buf, size_t buf_len, int load_only)
 

Variables

char ** environ
 
static uint64_t os_pending_signals
 
static int(* os_poll_func )(JSContext *ctx)
 
static JSClassID js_std_file_class_id
 
static JSClassDef js_std_file_class
 
static const JSCFunctionListEntry js_std_error_props []
 
static const JSCFunctionListEntry js_std_funcs []
 
static const JSCFunctionListEntry js_std_file_proto_funcs []
 
static struct termios oldtty
 
static JSClassID js_os_timer_class_id
 
static JSClassDef js_os_timer_class
 
static JSClassID js_worker_class_id
 
static JSContext *(* js_worker_new_context_func )(JSRuntime *rt)
 
static JSClassDef js_worker_class
 
static const JSCFunctionListEntry js_worker_proto_funcs []
 
static const JSCFunctionListEntry js_os_funcs []
 

Data Structure Documentation

◆ JSOSRWHandler

struct JSOSRWHandler
+ Collaboration diagram for JSOSRWHandler:
Data Fields
struct list_head link
int fd
JSValue rw_func[2]

◆ JSOSSignalHandler

struct JSOSSignalHandler
+ Collaboration diagram for JSOSSignalHandler:
Data Fields
struct list_head link
int sig_num
JSValue func

◆ JSOSTimer

struct JSOSTimer
+ Collaboration diagram for JSOSTimer:
Data Fields
struct list_head link
BOOL has_object
int64_t timeout
JSValue func

◆ JSWorkerMessage

struct JSWorkerMessage
+ Collaboration diagram for JSWorkerMessage:
Data Fields
struct list_head link
uint8_t * data
size_t data_len
uint8_t ** sab_tab
size_t sab_tab_len

◆ JSWorkerMessagePipe

struct JSWorkerMessagePipe
+ Collaboration diagram for JSWorkerMessagePipe:
Data Fields
int ref_count
GF_Mutex * mutex
struct list_head msg_queue
int read_fd
int write_fd

◆ JSWorkerMessageHandler

struct JSWorkerMessageHandler
+ Collaboration diagram for JSWorkerMessageHandler:
Data Fields
struct list_head link
JSWorkerMessagePipe * recv_pipe
JSValue on_message_func

◆ JSThreadState

struct JSThreadState
+ Collaboration diagram for JSThreadState:
Data Fields
struct list_head os_rw_handlers
struct list_head os_signal_handlers
struct list_head os_timers
struct list_head port_list
int eval_script_recurse
JSWorkerMessagePipe * recv_pipe
JSWorkerMessagePipe * send_pipe
int terminated

◆ JSSTDFile

struct JSSTDFile
Data Fields
FILE * f
BOOL close_in_finalizer
BOOL is_popen

◆ JSWorkerData

struct JSWorkerData
+ Collaboration diagram for JSWorkerData:
Data Fields
JSWorkerMessagePipe * recv_pipe
JSWorkerMessagePipe * send_pipe
JSWorkerMessageHandler * msg_handler
JSThreadState * ts
GF_Thread * th

◆ WorkerFuncArgs

struct WorkerFuncArgs
+ Collaboration diagram for WorkerFuncArgs:
Data Fields
char * filename
char * basename
JSWorkerMessagePipe * recv_pipe
JSWorkerMessagePipe * send_pipe
JSWorkerData * worker

◆ JSSABHeader

struct JSSABHeader
Data Fields
int ref_count
uint64_t buf[0]

Macro Definition Documentation

◆ USE_WORKER

#define USE_WORKER

◆ URL_GET_PROGRAM

#define URL_GET_PROGRAM   "curl -s -i"

◆ URL_GET_BUF_SIZE

#define URL_GET_BUF_SIZE   4096

◆ DEF

#define DEF (   x)    JS_PROP_INT32_DEF(#x, x, JS_PROP_CONFIGURABLE )

◆ OS_PLATFORM

#define OS_PLATFORM   "linux"

◆ OS_FLAG

#define OS_FLAG (   x)    JS_PROP_INT32_DEF(#x, x, JS_PROP_CONFIGURABLE )

Typedef Documentation

◆ mysighandler_t

typedef void(* mysighandler_t) (int sig_num)

◆ JSInitModuleFunc

typedef JSModuleDef*() JSInitModuleFunc(JSContext *ctx, const char *module_name)

Function Documentation

◆ js_std_dbuf_init()

static void js_std_dbuf_init ( JSContext ctx,
DynBuf s 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ my_isdigit()

static BOOL my_isdigit ( int  c)
static
+ Here is the caller graph for this function:

◆ js_printf_internal()

static JSValue js_printf_internal ( JSContext ctx,
int  argc,
JSValueConst argv,
FILE *  fp 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_load_file()

uint8_t* js_load_file ( JSContext ctx,
size_t *  pbuf_len,
const char *  filename 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_loadScript()

static JSValue js_loadScript ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_loadFile()

static JSValue js_std_loadFile ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_module_loader_so()

static JSModuleDef* js_module_loader_so ( JSContext ctx,
const char *  module_name 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_module_set_import_meta()

int js_module_set_import_meta ( JSContext ctx,
JSValueConst  func_val,
JS_BOOL  use_realpath,
JS_BOOL  is_main 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_module_loader()

JSModuleDef* js_module_loader ( JSContext ctx,
const char *  module_name,
void *  opaque 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_exit()

static JSValue js_std_exit ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_getenv()

static JSValue js_std_getenv ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_setenv()

static JSValue js_std_setenv ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_unsetenv()

static JSValue js_std_unsetenv ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_getenviron()

static JSValue js_std_getenviron ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_gc()

static JSValue js_std_gc ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ interrupt_handler()

static int interrupt_handler ( JSRuntime rt,
void *  opaque 
)
static
+ Here is the caller graph for this function:

◆ get_bool_option()

static int get_bool_option ( JSContext ctx,
BOOL pbool,
JSValueConst  obj,
const char *  option 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_evalScript()

static JSValue js_evalScript ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_finalizer()

static void js_std_file_finalizer ( JSRuntime rt,
JSValue  val 
)
static
+ Here is the call graph for this function:

◆ js_get_errno()

static ssize_t js_get_errno ( ssize_t  ret)
static
+ Here is the caller graph for this function:

◆ js_std_strerror()

static JSValue js_std_strerror ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_parseExtJSON()

static JSValue js_std_parseExtJSON ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_new_std_file()

static JSValue js_new_std_file ( JSContext ctx,
FILE *  f,
BOOL  close_in_finalizer,
BOOL  is_popen 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_set_error_object()

static void js_set_error_object ( JSContext ctx,
JSValue  obj,
int  err 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_open()

static JSValue js_std_open ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_popen()

static JSValue js_std_popen ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_fdopen()

static JSValue js_std_fdopen ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_tmpfile()

static JSValue js_std_tmpfile ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_sprintf()

static JSValue js_std_sprintf ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_printf()

static JSValue js_std_printf ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_get()

static FILE* js_std_file_get ( JSContext ctx,
JSValueConst  obj 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_file_puts()

static JSValue js_std_file_puts ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv,
int  magic 
)
static
+ Here is the call graph for this function:

◆ js_std_file_close()

static JSValue js_std_file_close ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_printf()

static JSValue js_std_file_printf ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_flush()

static JSValue js_std_file_flush ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_tell()

static JSValue js_std_file_tell ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv,
int  is_bigint 
)
static
+ Here is the call graph for this function:

◆ js_std_file_seek()

static JSValue js_std_file_seek ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_eof()

static JSValue js_std_file_eof ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_error()

static JSValue js_std_file_error ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_clearerr()

static JSValue js_std_file_clearerr ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_fileno()

static JSValue js_std_file_fileno ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_read_write()

static JSValue js_std_file_read_write ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv,
int  magic 
)
static
+ Here is the call graph for this function:

◆ js_std_file_getline()

static JSValue js_std_file_getline ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_readAsString()

static JSValue js_std_file_readAsString ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_getByte()

static JSValue js_std_file_getByte ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_file_putByte()

static JSValue js_std_file_putByte ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ http_get_header_line()

static int http_get_header_line ( FILE *  f,
char *  buf,
size_t  buf_size,
DynBuf dbuf 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ http_get_status()

static int http_get_status ( const char *  buf)
static
+ Here is the caller graph for this function:

◆ js_std_urlGet()

static JSValue js_std_urlGet ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_std_init()

static int js_std_init ( JSContext ctx,
JSModuleDef m 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_init_module_std()

JSModuleDef* js_init_module_std ( JSContext ctx,
const char *  module_name 
)
+ Here is the call graph for this function:

◆ js_os_open()

static JSValue js_os_open ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_close()

static JSValue js_os_close ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_seek()

static JSValue js_os_seek ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_read_write()

static JSValue js_os_read_write ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv,
int  magic 
)
static
+ Here is the call graph for this function:

◆ js_os_isatty()

static JSValue js_os_isatty ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_ttyGetWinSize()

static JSValue js_os_ttyGetWinSize ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ term_exit()

static void term_exit ( void  )
static
+ Here is the caller graph for this function:

◆ js_os_ttySetRaw()

static JSValue js_os_ttySetRaw ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_remove()

static JSValue js_os_remove ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_rename()

static JSValue js_os_rename ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ is_main_thread()

static BOOL is_main_thread ( JSRuntime rt)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_rh()

static JSOSRWHandler* find_rh ( JSThreadState ts,
int  fd 
)
static
+ Here is the caller graph for this function:

◆ free_rw_handler()

static void free_rw_handler ( JSRuntime rt,
JSOSRWHandler rh 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_os_setReadHandler()

static JSValue js_os_setReadHandler ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv,
int  magic 
)
static
+ Here is the call graph for this function:

◆ find_sh()

static JSOSSignalHandler* find_sh ( JSThreadState ts,
int  sig_num 
)
static
+ Here is the caller graph for this function:

◆ free_sh()

static void free_sh ( JSRuntime rt,
JSOSSignalHandler sh 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ os_signal_handler()

static void os_signal_handler ( int  sig_num)
static
+ Here is the caller graph for this function:

◆ js_os_signal()

static JSValue js_os_signal ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ get_time_ms()

static int64_t get_time_ms ( void  )
static
+ Here is the caller graph for this function:

◆ unlink_timer()

static void unlink_timer ( JSRuntime rt,
JSOSTimer th 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_timer()

static void free_timer ( JSRuntime rt,
JSOSTimer th 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_os_timer_finalizer()

static void js_os_timer_finalizer ( JSRuntime rt,
JSValue  val 
)
static
+ Here is the call graph for this function:

◆ js_os_timer_mark()

static void js_os_timer_mark ( JSRuntime rt,
JSValueConst  val,
JS_MarkFunc mark_func 
)
static
+ Here is the call graph for this function:

◆ js_os_setTimeout()

static JSValue js_os_setTimeout ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_clearTimeout()

static JSValue js_os_clearTimeout ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ call_handler()

static void call_handler ( JSContext ctx,
JSValueConst  func 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_free_message()

static void js_free_message ( JSWorkerMessage msg)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handle_posted_message()

static int handle_posted_message ( JSRuntime rt,
JSContext ctx,
JSWorkerMessageHandler port 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_os_poll()

static int js_os_poll ( JSContext ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_obj_error()

static JSValue make_obj_error ( JSContext ctx,
JSValue  obj,
int  err 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_string_error()

static JSValue make_string_error ( JSContext ctx,
const char *  buf,
int  err 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_os_getcwd()

static JSValue js_os_getcwd ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_chdir()

static JSValue js_os_chdir ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_mkdir()

static JSValue js_os_mkdir ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_readdir()

static JSValue js_os_readdir ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ timespec_to_ms()

static int64_t timespec_to_ms ( const struct timespec *  tv)
static
+ Here is the caller graph for this function:

◆ js_os_stat()

static JSValue js_os_stat ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv,
int  is_lstat 
)
static
+ Here is the call graph for this function:

◆ ms_to_timeval()

static void ms_to_timeval ( struct timeval *  tv,
uint64_t  v 
)
static
+ Here is the caller graph for this function:

◆ js_os_utimes()

static JSValue js_os_utimes ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_sleep()

static JSValue js_os_sleep ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_realpath()

static JSValue js_os_realpath ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_symlink()

static JSValue js_os_symlink ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_readlink()

static JSValue js_os_readlink ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ build_envp()

static char** build_envp ( JSContext ctx,
JSValueConst  obj 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ my_execvpe()

static int my_execvpe ( const char *  filename,
char **  argv,
char **  envp 
)
static
+ Here is the caller graph for this function:

◆ js_os_exec()

static JSValue js_os_exec ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_waitpid()

static JSValue js_os_waitpid ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_kill()

static JSValue js_os_kill ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_pipe()

static JSValue js_os_pipe ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_dup()

static JSValue js_os_dup ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_os_dup2()

static JSValue js_os_dup2 ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ atomic_add_int()

static int atomic_add_int ( int *  ptr,
int  v 
)
static
+ Here is the caller graph for this function:

◆ js_sab_alloc()

static void* js_sab_alloc ( void *  opaque,
size_t  size 
)
static
+ Here is the caller graph for this function:

◆ js_sab_free()

static void js_sab_free ( void *  opaque,
void *  ptr 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_sab_dup()

static void js_sab_dup ( void *  opaque,
void *  ptr 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_new_message_pipe()

static JSWorkerMessagePipe* js_new_message_pipe ( void  )
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_dup_message_pipe()

static JSWorkerMessagePipe* js_dup_message_pipe ( JSWorkerMessagePipe ps)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_free_message_pipe()

static void js_free_message_pipe ( JSWorkerMessagePipe ps)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_free_port()

static void js_free_port ( JSRuntime rt,
JSWorkerMessageHandler port 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_worker_finalizer()

static void js_worker_finalizer ( JSRuntime rt,
JSValue  val 
)
static
+ Here is the call graph for this function:

◆ js_std_free_handlers_ex()

static void js_std_free_handlers_ex ( JSRuntime rt,
int  no_free_ts 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ worker_func()

static unsigned int worker_func ( void *  opaque)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_worker_ctor_internal()

static JSValue js_worker_ctor_internal ( JSContext ctx,
JSValueConst  new_target,
JSWorkerMessagePipe recv_pipe,
JSWorkerMessagePipe send_pipe 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_worker_ctor()

static JSValue js_worker_ctor ( JSContext ctx,
JSValueConst  new_target,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_worker_postMessage()

static JSValue js_worker_postMessage ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:

◆ js_worker_set_onmessage()

static JSValue js_worker_set_onmessage ( JSContext ctx,
JSValueConst  this_val,
JSValueConst  func 
)
static
+ Here is the call graph for this function:

◆ js_worker_get_onmessage()

static JSValue js_worker_get_onmessage ( JSContext ctx,
JSValueConst  this_val 
)
static
+ Here is the call graph for this function:

◆ js_std_set_worker_new_context_func()

void js_std_set_worker_new_context_func ( JSContext *(*)(JSRuntime *rt)  func)

◆ js_os_init()

static int js_os_init ( JSContext ctx,
JSModuleDef m 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_init_module_os()

JSModuleDef* js_init_module_os ( JSContext ctx,
const char *  module_name 
)
+ Here is the call graph for this function:

◆ js_print()

static JSValue js_print ( JSContext ctx,
JSValueConst  this_val,
int  argc,
JSValueConst argv 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_add_helpers()

void js_std_add_helpers ( JSContext ctx,
int  argc,
char **  argv 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_init_handlers()

void js_std_init_handlers ( JSRuntime rt)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_free_handlers()

void js_std_free_handlers ( JSRuntime rt)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_dump_obj()

static void js_dump_obj ( JSContext ctx,
FILE *  f,
JSValueConst  val 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_dump_error1()

static void js_std_dump_error1 ( JSContext ctx,
JSValueConst  exception_val 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_dump_error()

void js_std_dump_error ( JSContext ctx)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_promise_rejection_tracker()

void js_std_promise_rejection_tracker ( JSContext ctx,
JSValueConst  promise,
JSValueConst  reason,
BOOL  is_handled,
void *  opaque 
)
+ Here is the call graph for this function:

◆ js_std_loop()

void js_std_loop ( JSContext ctx)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ js_std_eval_binary()

void js_std_eval_binary ( JSContext ctx,
const uint8_t buf,
size_t  buf_len,
int  load_only 
)

Variable Documentation

◆ environ

char** environ
extern

◆ os_pending_signals

uint64_t os_pending_signals
static

◆ os_poll_func

int(* os_poll_func) (JSContext *ctx) ( JSContext ctx)
static

◆ js_std_file_class_id

JSClassID js_std_file_class_id
static

◆ js_std_file_class

JSClassDef js_std_file_class
static
Initial value:
= {
"FILE",
.finalizer = js_std_file_finalizer,
}
static void js_std_file_finalizer(JSRuntime *rt, JSValue val)
Definition: quickjs-libc.c:883

◆ js_std_error_props

const JSCFunctionListEntry js_std_error_props[]
static
Initial value:
= {
#define DEF(x)
DEF(EINVAL),
DEF(EIO),
DEF(EACCES),
DEF(EEXIST),
DEF(ENOSPC),
DEF(ENOSYS),
DEF(EBUSY),
DEF(ENOENT),
DEF(EPERM),
DEF(EPIPE),
DEF(EBADF),
}
#define DEF(x)

◆ js_std_funcs

const JSCFunctionListEntry js_std_funcs[]
static
Initial value:
= {
JS_CFUNC_DEF("exit", 1, js_std_exit ),
JS_CFUNC_DEF("gc", 0, js_std_gc ),
JS_CFUNC_DEF("evalScript", 1, js_evalScript ),
JS_CFUNC_DEF("loadScript", 1, js_loadScript ),
JS_CFUNC_DEF("getenv", 1, js_std_getenv ),
JS_CFUNC_DEF("setenv", 1, js_std_setenv ),
JS_CFUNC_DEF("unsetenv", 1, js_std_unsetenv ),
JS_CFUNC_DEF("getenviron", 1, js_std_getenviron ),
JS_CFUNC_DEF("urlGet", 1, js_std_urlGet ),
JS_CFUNC_DEF("loadFile", 1, js_std_loadFile ),
JS_CFUNC_DEF("strerror", 1, js_std_strerror ),
JS_CFUNC_DEF("parseExtJSON", 1, js_std_parseExtJSON ),
JS_CFUNC_DEF("open", 2, js_std_open ),
JS_CFUNC_DEF("popen", 2, js_std_popen ),
JS_CFUNC_DEF("fdopen", 2, js_std_fdopen ),
JS_CFUNC_DEF("tmpfile", 0, js_std_tmpfile ),
JS_CFUNC_DEF("printf", 1, js_std_printf ),
JS_CFUNC_DEF("sprintf", 1, js_std_sprintf ),
JS_PROP_INT32_DEF("SEEK_SET", SEEK_SET, JS_PROP_CONFIGURABLE ),
JS_PROP_INT32_DEF("SEEK_CUR", SEEK_CUR, JS_PROP_CONFIGURABLE ),
JS_PROP_INT32_DEF("SEEK_END", SEEK_END, JS_PROP_CONFIGURABLE ),
}
#define countof(x)
Definition: cutils.h:61
static JSValue js_std_unsetenv(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:754
static JSValue js_std_getenv(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:699
static JSValue js_std_exit(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:689
static JSValue js_std_parseExtJSON(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:913
static JSValue js_std_strerror(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:904
static JSValue js_std_fdopen(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1028
static JSValue js_evalScript(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:832
static JSValue js_std_printf(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1079
static JSValue js_std_getenviron(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:768
static JSValue js_std_urlGet(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1394
static JSValue js_std_open(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:956
static JSValue js_std_loadFile(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:505
static JSValue js_std_gc(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:805
static const JSCFunctionListEntry js_std_error_props[]
Definition: quickjs-libc.c:1546
static JSValue js_std_tmpfile(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1061
static JSValue js_std_sprintf(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1073
static JSValue js_std_setenv(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:736
static JSValue js_loadScript(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:480
static JSValue js_std_file_puts(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
Definition: quickjs-libc.c:1097
static JSValue js_std_popen(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:992
#define JS_PROP_INT32_DEF(name, val, prop_flags)
Definition: quickjs.h:1049
#define JS_CFUNC_MAGIC_DEF(name, length, func1, magic)
Definition: quickjs.h:1043
#define JS_CFUNC_DEF(name, length, func1)
Definition: quickjs.h:1042
#define JS_PROP_CONFIGURABLE
Definition: quickjs.h:273
#define JS_OBJECT_DEF(name, tab, len, prop_flags)
Definition: quickjs.h:1053

◆ js_std_file_proto_funcs

const JSCFunctionListEntry js_std_file_proto_funcs[]
static
Initial value:
= {
JS_CFUNC_DEF("readAsString", 0, js_std_file_readAsString ),
}
static JSValue js_std_file_read_write(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int magic)
Definition: quickjs-libc.c:1228
static JSValue js_std_file_tell(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, int is_bigint)
Definition: quickjs-libc.c:1159
static JSValue js_std_file_flush(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1149
static JSValue js_std_file_printf(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1140
static JSValue js_std_file_fileno(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1219
static JSValue js_std_file_error(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1200
static JSValue js_std_file_putByte(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1342
static JSValue js_std_file_eof(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1191
static JSValue js_std_file_clearerr(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1209
static JSValue js_std_file_getByte(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1333
static JSValue js_std_file_seek(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1173
static JSValue js_std_file_close(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1123
static JSValue js_std_file_readAsString(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1291
static JSValue js_std_file_getline(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:1255

◆ oldtty

struct termios oldtty
static

◆ js_os_timer_class_id

JSClassID js_os_timer_class_id
static

◆ js_os_timer_class

JSClassDef js_os_timer_class
static
Initial value:
= {
"OSTimer",
.finalizer = js_os_timer_finalizer,
.gc_mark = js_os_timer_mark,
}
static void js_os_timer_finalizer(JSRuntime *rt, JSValue val)
Definition: quickjs-libc.c:2102
static void js_os_timer_mark(JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
Definition: quickjs-libc.c:2112

◆ js_worker_class_id

JSClassID js_worker_class_id
static

◆ js_worker_new_context_func

JSContext*(* js_worker_new_context_func) (JSRuntime *rt) ( JSRuntime rt)
static

◆ js_worker_class

JSClassDef js_worker_class
static
Initial value:
= {
"Worker",
.finalizer = js_worker_finalizer,
}
static void js_worker_finalizer(JSRuntime *rt, JSValue val)
Definition: quickjs-libc.c:3687

◆ js_worker_proto_funcs

const JSCFunctionListEntry js_worker_proto_funcs[]
static
Initial value:
= {
JS_CFUNC_DEF("postMessage", 1, js_worker_postMessage ),
}
static JSValue js_worker_set_onmessage(JSContext *ctx, JSValueConst this_val, JSValueConst func)
Definition: quickjs-libc.c:3959
static JSValue js_worker_get_onmessage(JSContext *ctx, JSValueConst this_val)
Definition: quickjs-libc.c:3994
static JSValue js_worker_postMessage(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition: quickjs-libc.c:3884
#define JS_CGETSET_DEF(name, fgetter, fsetter)
Definition: quickjs.h:1046

◆ js_os_funcs

const JSCFunctionListEntry js_os_funcs[]
static