XenevaOS
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
js.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
Include dependency graph for js.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NS_JS_SCRIPT_MAX   (64 * 1024)
 
#define NS_JS_KIND_WRITE   0 /* document.write: carries the current run style */
 
#define NS_JS_KIND_LOG   1 /* console.log/info/debug: dim gray */
 
#define NS_JS_KIND_WARN   2 /* console.warn + alert: amber */
 
#define NS_JS_KIND_ERR   3 /* console.error + uncaught exceptions: red */
 

Typedefs

typedef void NsJsSinkFn(const char *s, size_t n, int kind)
 

Functions

void NsJsSetSink (NsJsSinkFn *fn)
 
void NsJsBegin (const char *url)
 
void NsJsScanTitle (const char *src, size_t len)
 
void NsJsScriptChunk (char c)
 
void NsJsScriptSrcAttr (const char *attr)
 
void NsJsScriptType (const char *type)
 
void NsJsRunPending (void)
 
void NsJsFlushConsole (void)
 
void NsJsEnd (void)
 
bool NsJsTick (void)
 
int NsJsTimerCount (void)
 
int NsJsConsumeNav (char *out, size_t outsz)
 
void NsJsSetDocument (struct NsCssNode *root)
 
int NsJsConsumeDirty (void)
 
const char * NsJsVersion (void)
 
int NsJsActive (void)
 
int NsJsDefined (const char *name)
 

Macro Definition Documentation

◆ NS_JS_KIND_ERR

#define NS_JS_KIND_ERR   3 /* console.error + uncaught exceptions: red */

◆ NS_JS_KIND_LOG

#define NS_JS_KIND_LOG   1 /* console.log/info/debug: dim gray */

◆ NS_JS_KIND_WARN

#define NS_JS_KIND_WARN   2 /* console.warn + alert: amber */

◆ NS_JS_KIND_WRITE

#define NS_JS_KIND_WRITE   0 /* document.write: carries the current run style */

◆ NS_JS_SCRIPT_MAX

#define NS_JS_SCRIPT_MAX   (64 * 1024)

NetSurf QuickJS host for XenevaOS.

Runs page <script> bodies in document order while the readability pass parses. No DOM tree yet: the host exposes a scripting shell that can run logic and emit text through the renderer – console lines and document.write output land inline at the position the script executes.

Exposes only QuickJS's core intrinsics (Math/JSON/RegExp/Intl...); the DOM, CSSOM, images and network fetchers are future work (README).

Typedef Documentation

◆ NsJsSinkFn

typedef void NsJsSinkFn(const char *s, size_t n, int kind)

Function Documentation

◆ NsJsActive()

int NsJsActive ( void  )

◆ NsJsBegin()

void NsJsBegin ( const char *  url)

◆ NsJsConsumeDirty()

int NsJsConsumeDirty ( void  )

◆ NsJsConsumeNav()

int NsJsConsumeNav ( char *  out,
size_t  outsz 
)

◆ NsJsDefined()

int NsJsDefined ( const char *  name)

◆ NsJsEnd()

void NsJsEnd ( void  )

◆ NsJsFlushConsole()

void NsJsFlushConsole ( void  )

◆ NsJsRunPending()

void NsJsRunPending ( void  )

◆ NsJsScanTitle()

void NsJsScanTitle ( const char *  src,
size_t  len 
)

◆ NsJsScriptChunk()

void NsJsScriptChunk ( char  c)

◆ NsJsScriptSrcAttr()

void NsJsScriptSrcAttr ( const char *  attr)

◆ NsJsScriptType()

void NsJsScriptType ( const char *  type)

◆ NsJsSetDocument()

void NsJsSetDocument ( struct NsCssNode *  root)

◆ NsJsSetSink()

void NsJsSetSink ( NsJsSinkFn *  fn)

◆ NsJsTick()

bool NsJsTick ( void  )

◆ NsJsTimerCount()

int NsJsTimerCount ( void  )

◆ NsJsVersion()

const char * NsJsVersion ( void  )