Skip to main content

Module shell_builtins

Module shell_builtins 

Source
Expand description

Shell builtin IDs for CallBuiltin(id, argc) dispatch.

These IDs are used by shell frontends (zshrs) to emit bytecodes that call registered builtin handlers. The VM dispatches through the pre-registered function pointer table — no name lookup at runtime.

Usage in frontend compiler:

use fusevm::{ChunkBuilder, Op};
use fusevm::shell_builtins::*;

let mut builder = ChunkBuilder::new();
builder.emit(Op::CallBuiltin(BUILTIN_CD, 1), 1);

Usage in frontend VM init:

use fusevm::{ChunkBuilder, VM, Value};
use fusevm::shell_builtins::*;

let chunk = ChunkBuilder::new().build();
let mut vm = VM::new(chunk);
vm.register_builtin(BUILTIN_CD, |_vm, _argc| Value::Status(0));

Constants§

BUILTIN_ALIAS
Dispatch ID for the shell alias builtin.
BUILTIN_ASYNC
Dispatch ID for the shell async builtin.
BUILTIN_AUTOLOAD
Dispatch ID for the shell autoload builtin.
BUILTIN_AWAIT
Dispatch ID for the shell await builtin.
BUILTIN_BARRIER
Dispatch ID for the shell barrier builtin.
BUILTIN_BASENAME
Dispatch ID for the shell basename builtin.
BUILTIN_BG
Dispatch ID for the shell bg builtin.
BUILTIN_BINDKEY
Dispatch ID for the shell bindkey builtin.
BUILTIN_BREAK
Dispatch ID for the shell break builtin.
BUILTIN_BUILTIN
Dispatch ID for the shell builtin builtin.
BUILTIN_CALLER
Dispatch ID for the shell caller builtin.
BUILTIN_CAT
Dispatch ID for the shell cat builtin.
BUILTIN_CD
Dispatch ID for the shell cd builtin.
BUILTIN_CDREPLAY
Dispatch ID for the shell cdreplay builtin.
BUILTIN_COLON
Dispatch ID for the shell : builtin.
BUILTIN_COMMAND
Dispatch ID for the shell command builtin.
BUILTIN_COMPADD
Dispatch ID for the shell compadd builtin.
BUILTIN_COMPDEF
Dispatch ID for the shell compdef builtin.
BUILTIN_COMPGEN
Dispatch ID for the shell compgen builtin.
BUILTIN_COMPINIT
Dispatch ID for the shell compinit builtin.
BUILTIN_COMPLETE
Dispatch ID for the shell complete builtin.
BUILTIN_COMPOPT
Dispatch ID for the shell compopt builtin.
BUILTIN_COMPSET
Dispatch ID for the shell compset builtin.
BUILTIN_CONTINUE
Dispatch ID for the shell continue builtin.
BUILTIN_CUT
Dispatch ID for the shell cut builtin.
BUILTIN_DATE
Dispatch ID for the shell date builtin.
BUILTIN_DBVIEW
Dispatch ID for the shell dbview builtin.
BUILTIN_DECLARE
Dispatch ID for the shell declare builtin.
BUILTIN_DIRNAME
Dispatch ID for the shell dirname builtin.
BUILTIN_DIRS
Dispatch ID for the shell dirs builtin.
BUILTIN_DISABLE
Dispatch ID for the shell disable builtin.
BUILTIN_DISOWN
Dispatch ID for the shell disown builtin.
BUILTIN_DOCTOR
Dispatch ID for the shell doctor builtin.
BUILTIN_DOT
Dispatch ID for the shell . builtin.
BUILTIN_ECHO
Dispatch ID for the shell echo builtin.
BUILTIN_EMULATE
Dispatch ID for the shell emulate builtin.
BUILTIN_ENABLE
Dispatch ID for the shell enable builtin.
BUILTIN_EVAL
Dispatch ID for the shell eval builtin.
BUILTIN_EXEC
Dispatch ID for the shell exec builtin.
BUILTIN_EXIT
Dispatch ID for the shell exit builtin.
BUILTIN_EXPORT
Dispatch ID for the shell export builtin.
BUILTIN_FALSE
Dispatch ID for the shell false builtin.
BUILTIN_FC
Dispatch ID for the shell fc builtin.
BUILTIN_FG
Dispatch ID for the shell fg builtin.
BUILTIN_FIND
Dispatch ID for the shell find builtin.
BUILTIN_FLOAT
Dispatch ID for the shell float builtin.
BUILTIN_FUNCTIONS
Dispatch ID for the shell functions builtin.
BUILTIN_GETOPTS
Dispatch ID for the shell getopts builtin.
BUILTIN_HASH
Dispatch ID for the shell hash builtin.
BUILTIN_HEAD
Dispatch ID for the shell head builtin.
BUILTIN_HELP
Dispatch ID for the shell help builtin.
BUILTIN_HISTORY
Dispatch ID for the shell history builtin.
BUILTIN_HOSTNAME
Dispatch ID for the shell hostname builtin.
BUILTIN_ID
Dispatch ID for the shell id builtin.
BUILTIN_INTEGER
Dispatch ID for the shell integer builtin.
BUILTIN_INTERCEPT
Dispatch ID for the shell intercept builtin.
BUILTIN_INTERCEPT_PROCEED
Dispatch ID for the shell intercept_proceed builtin.
BUILTIN_JOBS
Dispatch ID for the shell jobs builtin.
BUILTIN_KILL
Dispatch ID for the shell kill builtin.
BUILTIN_LET
Dispatch ID for the shell let builtin.
BUILTIN_LIMIT
Dispatch ID for the shell limit builtin.
BUILTIN_LOCAL
Dispatch ID for the shell local builtin.
BUILTIN_MAPFILE
Dispatch ID for the shell mapfile builtin.
BUILTIN_MAX
Maximum builtin ID (for pre-allocating the handler table)
BUILTIN_MKDIR
Dispatch ID for the shell mkdir builtin.
BUILTIN_MKTEMP
Dispatch ID for the shell mktemp builtin.
BUILTIN_NOGLOB
Dispatch ID for the shell noglob builtin.
BUILTIN_PCRE_COMPILE
Dispatch ID for the shell pcre_compile builtin.
BUILTIN_PCRE_MATCH
Dispatch ID for the shell pcre_match builtin.
BUILTIN_PCRE_STUDY
Dispatch ID for the shell pcre_study builtin.
BUILTIN_PEACH
Dispatch ID for the shell peach builtin.
BUILTIN_PGREP
Dispatch ID for the shell pgrep builtin.
BUILTIN_PMAP
Dispatch ID for the shell pmap builtin.
BUILTIN_POPD
Dispatch ID for the shell popd builtin.
BUILTIN_PRINT
Dispatch ID for the shell print builtin.
BUILTIN_PRINTF
Dispatch ID for the shell printf builtin.
BUILTIN_PROFILE
Dispatch ID for the shell profile builtin.
BUILTIN_PROMPT
Dispatch ID for the shell prompt builtin.
BUILTIN_PROMPTINIT
Dispatch ID for the shell promptinit builtin.
BUILTIN_PUSHD
Dispatch ID for the shell pushd builtin.
BUILTIN_PWD
Dispatch ID for the shell pwd builtin.
BUILTIN_R
Dispatch ID for the shell r builtin.
BUILTIN_READ
Dispatch ID for the shell read builtin.
BUILTIN_READONLY
Dispatch ID for the shell readonly builtin.
BUILTIN_REALPATH
Dispatch ID for the shell realpath builtin.
BUILTIN_REHASH
Dispatch ID for the shell rehash builtin.
BUILTIN_RETURN
Dispatch ID for the shell return builtin.
BUILTIN_REV
Dispatch ID for the shell rev builtin.
BUILTIN_SEQ
Dispatch ID for the shell seq builtin.
BUILTIN_SET
Dispatch ID for the shell set builtin.
BUILTIN_SETOPT
Dispatch ID for the shell setopt builtin.
BUILTIN_SHIFT
Dispatch ID for the shell shift builtin.
BUILTIN_SHOPT
Dispatch ID for the shell shopt builtin.
BUILTIN_SLEEP
Dispatch ID for the shell sleep builtin.
BUILTIN_SORT
Dispatch ID for the shell sort builtin.
BUILTIN_SOURCE
Dispatch ID for the shell source builtin.
BUILTIN_STRFTIME
Dispatch ID for the shell strftime builtin.
BUILTIN_SUSPEND
Dispatch ID for the shell suspend builtin.
BUILTIN_SYNC
Dispatch ID for the shell sync builtin.
BUILTIN_TAIL
Dispatch ID for the shell tail builtin.
BUILTIN_TEE
Dispatch ID for the shell tee builtin.
BUILTIN_TEST
Dispatch ID for the shell test builtin.
BUILTIN_TIMES
Dispatch ID for the shell times builtin.
BUILTIN_TOUCH
Dispatch ID for the shell touch builtin.
BUILTIN_TR
Dispatch ID for the shell tr builtin.
BUILTIN_TRAP
Dispatch ID for the shell trap builtin.
BUILTIN_TRUE
Dispatch ID for the shell true builtin.
BUILTIN_TTYCTL
Dispatch ID for the shell ttyctl builtin.
BUILTIN_TYPE
Dispatch ID for the shell type builtin.
BUILTIN_TYPESET
Dispatch ID for the shell typeset builtin.
BUILTIN_ULIMIT
Dispatch ID for the shell ulimit builtin.
BUILTIN_UMASK
Dispatch ID for the shell umask builtin.
BUILTIN_UNALIAS
Dispatch ID for the shell unalias builtin.
BUILTIN_UNAME
Dispatch ID for the shell uname builtin.
BUILTIN_UNFUNCTION
Dispatch ID for the shell unfunction builtin.
BUILTIN_UNHASH
Dispatch ID for the shell unhash builtin.
BUILTIN_UNIQ
Dispatch ID for the shell uniq builtin.
BUILTIN_UNLIMIT
Dispatch ID for the shell unlimit builtin.
BUILTIN_UNSET
Dispatch ID for the shell unset builtin.
BUILTIN_UNSETOPT
Dispatch ID for the shell unsetopt builtin.
BUILTIN_VARED
Dispatch ID for the shell vared builtin.
BUILTIN_WAIT
Dispatch ID for the shell wait builtin.
BUILTIN_WC
Dispatch ID for the shell wc builtin.
BUILTIN_WHENCE
Dispatch ID for the shell whence builtin.
BUILTIN_WHERE
Dispatch ID for the shell where builtin.
BUILTIN_WHICH
Dispatch ID for the shell which builtin.
BUILTIN_WHOAMI
Dispatch ID for the shell whoami builtin.
BUILTIN_ZCOMPILE
Dispatch ID for the shell zcompile builtin.
BUILTIN_ZFORMAT
Dispatch ID for the shell zformat builtin.
BUILTIN_ZGDBMPATH
Dispatch ID for the shell zgdbmpath builtin.
BUILTIN_ZLE
Dispatch ID for the shell zle builtin.
BUILTIN_ZMODLOAD
Dispatch ID for the shell zmodload builtin.
BUILTIN_ZPARSEOPTS
Dispatch ID for the shell zparseopts builtin.
BUILTIN_ZPROF
Dispatch ID for the shell zprof builtin.
BUILTIN_ZREGEXPARSE
Dispatch ID for the shell zregexparse builtin.
BUILTIN_ZSLEEP
Dispatch ID for the shell zsleep builtin.
BUILTIN_ZSTYLE
Dispatch ID for the shell zstyle builtin.
BUILTIN_ZSYSTEM
Dispatch ID for the shell zsystem builtin.
BUILTIN_ZTIE
Dispatch ID for the shell ztie builtin.
BUILTIN_ZUNTIE
Dispatch ID for the shell zuntie builtin.

Functions§

builtin_id
Map builtin name to ID. Returns None for non-builtins.
is_builtin
Check if a command name is a builtin.