/* The codemode tool (codemode.c): Pi's codemode, a JavaScript script that calls pic's other tools,
* run by Bellard's QuickJS (vendor/quickjs) in a worker process of its own. Bundled, off by
* default: the setting codemode, or PIC_CODEMODE for one process (the terminal's /codemode). */
#ifndef PIC_CODEMODE_H
#define PIC_CODEMODE_H
#include "toolreg.h"
/* The registration; main.c registers it after the other bundled tools. */
extern pic_tool_def pic_codemode_tool;
/* Once the tools in play are known (pic_toolset_configure): codemode's description lists them,
* with their declarations, and its scripts may call them. */
void pic_codemode_prepare(void);
/* The worker: `pic __codemode-worker`, exec'd by a script's call with no environment and nothing
* open but descriptor 3, its socket to the call. Returns the exit status. */
int pic_codemode_worker(void);
/* set_codemode {"enabled": true|false}: the terminal's /codemode. */
extern const struct pic_rpc_command pic_set_codemode_rpc;
#endif