MultiverseSocial.com

Channel circle › core 7 Container › js

js (core 7, sub 14, flat id 126)

130 functions
SignaturePurposeSourceScope
static uint64_t JSNowUs(void)(no comment)jschannel/JSChannel.c:37static
static void JSPost(uint32_t op, uint32_t arg)(no comment)jschannel/JSChannel.c:38static
static int JscAllocUnit(struct JscUnit *u)(no comment)jschannel/JSChannel.c:65static
static uint32_t VmU32(void *vm, uint32_t off)(no comment)jschannel/JSChannel.c:93static
static void VmSetU32(void *vm, uint32_t off, uint32_t v)(no comment)jschannel/JSChannel.c:94static
static void * VmPtr(void *vm, uint32_t off)(no comment)jschannel/JSChannel.c:95static
static void * ImgDup(const void *p, size_t n)(no comment)jschannel/JSChannel.c:96static
static void ImgFreeUnit(struct JscUnit *u)(no comment)jschannel/JSChannel.c:97static
static struct JscUnit * ImgCopyUnit(const struct JscUnit *s)(no comment)jschannel/JSChannel.c:104static
static void JscImgRetire(struct JSChannel *c)(no comment)jschannel/JSChannel.c:124static
static int JscImgBind(struct JSChannel *c)(no comment)jschannel/JSChannel.c:142static
static int JscImgInit(struct JSChannel *c)(no comment)jschannel/JSChannel.c:154static
static void JscImgFree(struct JSChannel *c)(no comment)jschannel/JSChannel.c:163static
static void JscFree(struct JSChannel *c)JSCHANNEL-M5B ENDjschannel/JSChannel.c:174static
static void RtOpen(struct Channel *c)(no comment)jschannel/JSChannel.c:191static
void CloseJSChannel(struct Channel *ch)(no comment)jschannel/JSChannel.c:193public
struct JSChannel * OpenJSChannel(void)(no comment)jschannel/JSChannel.c:203public
uint64_t JoinJSChannel(void *peer)(no comment)jschannel/JSChannel.c:234public
void * LeaveJSChannel(void *peer)(no comment)jschannel/JSChannel.c:244public
static void Put32(uint8_t *p, uint32_t v)(no comment)jschannel/JSChannel.c:253static
static uint32_t Get32(const uint8_t *p)(no comment)jschannel/JSChannel.c:254static
static int JscOut(struct JSChannel *c, uint32_t op, const void *head, uint32_t hl, const void *body, uint32_t bl)queue one response record; payload = head (hl bytes) + body (bl bytes)jschannel/JSChannel.c:257static
static void JscErr(struct JSChannel *c, uint32_t req, uint32_t code, uint32_t pos, uint32_t line)(no comment)jschannel/JSChannel.c:271static
static int TmMentions(const uint8_t *s, uint32_t n)(no comment)jschannel/JSChannel.c:315static
static int TmRunSrc(struct JSChannel *c, const char *src, uint32_t n)compile + run a host script in the unit; then put the caller's loaded unit back. <0 error, else statusjschannel/JSChannel.c:326static
static void TmInstall(struct JSChannel *c)(no comment)jschannel/JSChannel.c:347static
static void TmTick(struct JSChannel *c)JS_TICK with timers installed and no run in progress: fire what is due. Result record only when one ran.jschannel/JSChannel.c:360static
static void EvCompile(struct JSChannel *c, const uint8_t *src, uint32_t n)JSCHANNEL-M6A ENDjschannel/JSChannel.c:381static
static void EvLoad(struct JSChannel *c, uint32_t req, const uint8_t *buf, uint32_t n)(no comment)jschannel/JSChannel.c:403static
static void JscDispatch(struct JSChannel *c, uint32_t ev, const uint8_t *p, uint32_t n)(no comment)jschannel/JSChannel.c:425static
uint64_t WriteJSChannel(void *ch, void *buf, long len)Write: one or more records. Returns bytes consumed (all of them; a bad tail queues ERROR BADREC).jschannel/JSChannel.c:485public
uint64_t ReadJSChannel(void *ch, void *buf, long len)Read: next response record. Returns its size, 0 if none, (uint64_t)-1 if buf too small.jschannel/JSChannel.c:502public
static uint64_t Ld64(const uint8_t *p)---- EditorChannel I/O ----jschannel/JSDom.c:58static
static uint32_t Ld32(const uint8_t *p)(no comment)jschannel/JSDom.c:59static
static uint32_t EdCall(struct JSDom *d, uint32_t op, uint64_t pos, uint32_t del, const void *data, uint32_t dl, uint64_t *ver, const uint8_t **pl, uint32_t *pn)(no comment)jschannel/JSDom.c:60static
static int FetchDoc(struct JSDom *d)(no comment)jschannel/JSDom.c:74static
static void SyncDoc(struct JSDom *d)the buffer moved under us (UNDO/REDO, another session): refetch, every space-0 handle diesjschannel/JSDom.c:91static
static int Scan(struct JSDom *d, uint32_t sp)---- scan cache ----jschannel/JSDom.c:101static
static int NodeOf(struct JSDom *d, uint32_t hi, struct EdtBmlNode *out, uint32_t *idx)(no comment)jschannel/JSDom.c:109static
static uint32_t Handle(struct JSDom *d, uint32_t sp, uint64_t off)(no comment)jschannel/JSDom.c:116static
static void Adjust(struct JSDom *d, uint32_t sp, uint64_t rs, uint64_t re_old, int64_t delta)bytes [rs, re_old) of space sp became [rs, re_old + delta): shift later handles, kill the ones insidejschannel/JSDom.c:129static
static int NewSpace(struct JSDom *d, const uint8_t *node, uint64_t n)(no comment)jschannel/JSDom.c:138static
static void FreeSpace(struct JSDom *d, uint32_t s)(no comment)jschannel/JSDom.c:151static
static int Splice(struct JSDom *d, uint32_t sp, uint64_t rs, uint64_t re, const uint8_t *ins, uint64_t n, uint32_t op, uint64_t op_pos, const uint8_t *op_data, uint32_t op_dl)replace [rs, re) of space sp by (ins, n). Space 0 goes through an EditorChannel op (op, pos, data).jschannel/JSDom.c:159static
static int LcEq(const uint8_t *a, uint32_t an, const char *b)---- names ----jschannel/JSDom.c:186static
static int TagOp(const uint8_t *s, uint32_t n)(no comment)jschannel/JSDom.c:192static
static int AttrID(const uint8_t *s, uint32_t n)(no comment)jschannel/JSDom.c:198static
static uint32_t Ld16(const uint8_t *p)(no comment)jschannel/JSDom.c:205static
static int IsStr(uint8_t t)(no comment)jschannel/JSDom.c:206static
static uint32_t Fixsz(uint8_t t)(no comment)jschannel/JSDom.c:207static
static uint64_t AttrAt(const uint8_t *b, uint64_t a, uint8_t *aid, uint8_t *tid, const uint8_t **v, uint32_t *vl)attr at a: id, [name], type, value. Returns the byte after it.jschannel/JSDom.c:213static
static int FindAttr(const uint8_t *b, const struct EdtBmlNode *nd, uint8_t want, uint8_t *tid, const uint8_t **v, uint32_t *vl)(no comment)jschannel/JSDom.c:221static
static int EncodeAttr(uint8_t aid, const uint8_t *s, uint32_t n, uint8_t *tid, uint8_t *out, uint32_t *on)JS string -> attr value bytes for attr aid (picks a type the attr allows)jschannel/JSDom.c:228static
static uint32_t DecodeAttr(uint8_t aid, uint8_t tid, const uint8_t *v, uint32_t vl, char *out, const uint8_t **sp)(no comment)jschannel/JSDom.c:262static
static void JbPut(struct Jb *b, const uint8_t *s, uint32_t n)(no comment)jschannel/JSDom.c:278static
static void TextOf(struct JSDom *d, const uint8_t *b, uint32_t idx, struct Jb *o)(no comment)jschannel/JSDom.c:290static
static int Ident(uint8_t c)(no comment)jschannel/JSDom.c:302static
static int ParseComp(const uint8_t *s, uint32_t n, uint32_t *i, struct Comp *c)(no comment)jschannel/JSDom.c:303static
static int HasToken(const uint8_t *v, uint32_t vl, const uint8_t *t, uint32_t tl)(no comment)jschannel/JSDom.c:317static
static int MatchComp(const uint8_t *b, const struct EdtBmlNode *nd, const struct Comp *c)(no comment)jschannel/JSDom.c:329static
static int MatchChain(struct JSDom *d, const uint8_t *b, uint32_t idx, const struct Comp *cs, uint32_t nc, uint64_t lo)node idx matches the selector chain comps[0..nc) (descendant combinators), ancestors bounded by root_end/startjschannel/JSDom.c:346static
static int Query(struct JSDom *d, uint32_t sp, uint32_t idx, const uint8_t *sel, uint32_t sn, uint32_t max)QUERY: descendants of node idx (or the whole space if idx == ~0) in document order -> d->qljschannel/JSDom.c:359static
static int Detach(struct JSDom *d, uint32_t hi)detach node (handle hi) from its space into a fresh fragment; its subtree handles move with itjschannel/JSDom.c:390static
static int Attach(struct JSDom *d, uint32_t ci, uint32_t sp, uint64_t pos)insert fragment root (handle ci) into the space of parent pi at pos; the fragment's handles move injschannel/JSDom.c:407static
static int SetAttr(struct JSDom *d, uint32_t hi, int aid, const uint8_t *val, uint32_t vl, int del)(no comment)jschannel/JSDom.c:420static
static int SetText(struct JSDom *d, uint32_t hi, const uint8_t *s, uint32_t n)(no comment)jschannel/JSDom.c:456static
static uint64_t Num(double x)(no comment)jschannel/JSDom.c:484static
static uint32_t Hid(const struct JSDom *d, uint32_t slot)M5B: JS / API handle id = slot + gen * JSDOM_MAX_HANDLESjschannel/JSDom.c:486static
static int Hdec(const struct JSDom *d, uint32_t id, uint32_t *slot)(no comment)jschannel/JSDom.c:487static
static uint64_t Numh(const struct JSDom *d, uint32_t slot)(no comment)jschannel/JSDom.c:494static
static void LsPurge(struct JSDom *d)(no comment)jschannel/JSDom.c:495static
static int ArgNum(uint32_t argc, const uint64_t *argv, uint32_t i, double *x)(no comment)jschannel/JSDom.c:500static
static int ArgH(struct JSDom *d, uint32_t argc, const uint64_t *argv, uint32_t i, uint32_t *h)(no comment)jschannel/JSDom.c:506static
static const uint8_t * ArgS(struct JscVM *vm, uint32_t argc, const uint64_t *argv, uint32_t i, uint32_t *n)(no comment)jschannel/JSDom.c:512static
static uint64_t RetH(struct JSDom *d, uint32_t sp, uint64_t off)(no comment)jschannel/JSDom.c:517static
static int IdxOfOp(struct JSDom *d, uint8_t op, uint32_t *idx)(no comment)jschannel/JSDom.c:518static
static int ChildOk(const struct EdtBmlNode *n)(no comment)jschannel/JSDom.c:525static
static int JsdomHost(void *ctx, struct JscVM *vm, uint32_t argc, const uint64_t *argv, uint64_t *out)(no comment)jschannel/JSDom.c:527static
struct JSDom * JSDomOpen(struct Channel *editor, uint64_t buf_id)(no comment)jschannel/JSDom.c:845public
void JSDomClose(struct JSDom *d)(no comment)jschannel/JSDom.c:858public
static void Put32N(uint8_t *p, uint32_t v)(no comment)jschannel/JSDom.c:866static
static uint32_t Get32N(const uint8_t *p)(no comment)jschannel/JSDom.c:867static
static int JSReq(struct JSDom *d, uint32_t op, const uint8_t *pl, uint32_t n, uint8_t *res, uint32_t rcap, uint32_t *rn)one record to JSChannel, then drain: 0 = RESULT for req (payload copied to out), else -error codejschannel/JSDom.c:869static
int JSDomRun(struct JSDom *d, const char *src, uint32_t n, char *out, uint32_t outcap, uint32_t *outlen)(no comment)jschannel/JSDom.c:891public
int JSDomPostEvent(struct JSDom *d, uint32_t chev, uint32_t node)(no comment)jschannel/JSDom.c:930public
int JSDomListening(const struct JSDom *d, uint32_t chev, uint32_t node)(no comment)jschannel/JSDom.c:941public
int JSDomPump(struct JSDom *d, char *out, uint32_t outcap, uint32_t *outlen)JSCHANNEL-M5B: deliver queued events now (a two-statement script through the same COMPILE/RUN records)jschannel/JSDom.c:949public
int JSDomDispatch(struct JSDom *d, uint32_t chev, uint32_t node, char *out, uint32_t outcap, uint32_t *outlen)(no comment)jschannel/JSDom.c:956public
uint32_t JSDomListenerCount(const struct JSDom *d)(no comment)jschannel/JSDom.c:961public
int JSDomNodeById(struct JSDom *d, const char *id)(no comment)jschannel/JSDom.c:962public
uint64_t JSDomVersion(const struct JSDom *d)(no comment)jschannel/JSDom.c:975public
uint64_t JSDomEdits(const struct JSDom *d)(no comment)jschannel/JSDom.c:976public
uint32_t JSDomLastStatus(const struct JSDom *d)(no comment)jschannel/JSDom.c:977public
int JSDomNodeAt(struct JSDom *d, uint64_t off)JSCHANNEL-M6 BEGIN (2026-10-27, PROVISIONAL): page host helpers (jschannel/JSPage.c). JSDomNodeAt: the element a click at source byte off means. Same rule as ComposerPreviewClick: a text node givesjschannel/JSDom.c:984public
int JSDomTick(struct JSDom *d, char *out, uint32_t outcap, uint32_t *outlen)(no comment)jschannel/JSDom.c:1006public
static uint64_t Ld64(const uint8_t *p)(no comment)jschannel/JSPage.c:43static
static uint32_t Ld32(const uint8_t *p)(no comment)jschannel/JSPage.c:44static
static void Plog(struct JSPage *p, const char *s, uint32_t n)(no comment)jschannel/JSPage.c:46static
static void Plogf(struct JSPage *p, const char *what, int rc)(no comment)jschannel/JSPage.c:55static
static uint32_t Ed(struct JSPage *p, uint32_t op, uint64_t pos, uint32_t del, const void *d, uint32_t dl, const uint8_t **pl, uint32_t *pn)(no comment)jschannel/JSPage.c:61static
static int Refresh(struct JSPage *p)(no comment)jschannel/JSPage.c:73static
static int StrTid(uint8_t t)(no comment)jschannel/JSPage.c:100static
static void PwOpen(void *u, uint8_t op, const uint8_t *nm, uint16_t nl, uint8_t na)(no comment)jschannel/JSPage.c:101static
static int Ieq(const uint8_t *v, uint32_t n, const char *s)(no comment)jschannel/JSPage.c:109static
static void PwAttr(void *u, uint8_t aid, const uint8_t *nm, uint16_t nl, uint8_t tid, const uint8_t *v, uint32_t vl)(no comment)jschannel/JSPage.c:116static
static void PwText(void *u, uint8_t op, const uint8_t *s, uint16_t n)(no comment)jschannel/JSPage.c:131static
static void PwDoc(void *u, const uint8_t *a, uint16_t la, const uint8_t *b, uint16_t lb, const uint8_t *c, uint16_t lc)(no comment)jschannel/JSPage.c:132static
static void PwClose(void *u, uint8_t op, uint8_t v)(no comment)jschannel/JSPage.c:134static
static void PwNop(void *u)(no comment)jschannel/JSPage.c:135static
static struct Pw * Walk(struct JSPage *p, const char *want_id)(no comment)jschannel/JSPage.c:136static
static void WalkFree(struct Pw *w)(no comment)jschannel/JSPage.c:150static
static char * InlineText(const struct JSPage *p, const struct Pw *w, uint32_t e, uint32_t *len)inline script text: the TEXT / CDATA children of element e, concatenated (u16be length + bytes each)jschannel/JSPage.c:153static
static int MentionsTimer(const char *s, uint32_t n)(no comment)jschannel/JSPage.c:170static
static int Run(struct JSPage *p, const char *src, uint32_t n)(no comment)jschannel/JSPage.c:177static
struct JSPage * JSPageOpen(const uint8_t *page, uint64_t n, const char *store_dir, JSPageFetchFn fetch, void *fetch_user)(no comment)jschannel/JSPage.c:186public
void JSPageClose(struct JSPage *p)(no comment)jschannel/JSPage.c:242public
const uint8_t * JSPageDoc(struct JSPage *p, uint64_t *n)(no comment)jschannel/JSPage.c:250public
uint64_t JSPageVersion(struct JSPage *p)(no comment)jschannel/JSPage.c:256public
int JSPageFocus(const struct JSPage *p)(no comment)jschannel/JSPage.c:257public
const char * JSPageLog(const struct JSPage *p)(no comment)jschannel/JSPage.c:258public
void JSPageGetStats(const struct JSPage *p, struct JSPageStats *s)(no comment)jschannel/JSPage.c:259public
int JSPageNodeById(struct JSPage *p, const char *id)(no comment)jschannel/JSPage.c:260public
static const char * EvName(uint32_t chev)(no comment)jschannel/JSPage.c:262static
static int Fire(struct JSPage *p, uint32_t chev, int node, const char *key)queue chev for node, then one run that sets the global `event` and pumps the queuejschannel/JSPage.c:269static
int JSPageEvent(struct JSPage *p, uint32_t chev, int node)(no comment)jschannel/JSPage.c:286public
int JSPageClick(struct JSPage *p, const struct BbLayout *lay, uint16_t x, uint16_t y)(no comment)jschannel/JSPage.c:287public
int JSPageKey(struct JSPage *p, uint32_t chev, const char *key)(no comment)jschannel/JSPage.c:305public
int JSPageTick(struct JSPage *p)(no comment)jschannel/JSPage.c:310public
int JSPageEval(struct JSPage *p, const char *src, char *out, uint32_t cap)(no comment)jschannel/JSPage.c:321public
int JSPageNodeXY(struct JSPage *p, const struct BbLayout *lay, const char *id, uint16_t *x, uint16_t *y)a layout point inside element #id (first text run of it, else its box): for tests and scripted inputjschannel/JSPage.c:332public

Core-level functions of core 7 · Core 7 in the full manual

The > Web 4 < Channel Paradigm · full manual · privacy · contact

Hits--