zpmod  b19981f
High-performance Zsh module for script optimization and filesystem helpers
module.c File Reference

zsh module glue: builtins table, features, and lifecycle hooks. More...

#include "zpmod.mdh"
#include "zpmod.pro"
#include "zpmod_builtins.h"
#include "zpmod_vendor_shims.h"
#include "zpmod_version.h"
Include dependency graph for module.c:

Go to the source code of this file.

Functions

int bin_zppathstat (char *nam, char **argv, Options ops, int func)
 zppathstat builtin entrypoint More...
 
int bin_zpdirlist (char *nam, char **argv, Options ops, int func)
 zpdirlist builtin entrypoint More...
 
int bin_zpreadfile (char *nam, char **argv, Options ops, int func)
 zpreadfile builtin entrypoint More...
 
int setup_ (UNUSED(Module m))
 Module setup: initialize option mapping and install source overrides. More...
 
int features_ (Module m, char ***features)
 Provide feature list (builtins) to zsh. More...
 
int enables_ (Module m, int **enables)
 Enable/disable builtins as requested by the shell. More...
 
int boot_ (UNUSED(Module m))
 Optional early boot hook (unused). More...
 
int cleanup_ (Module m)
 Cleanup features when unloading. More...
 
int finish_ (UNUSED(Module m))
 Finalize module: restore original source handlers. More...
 

Variables

static struct builtin bintab []
 
static struct features module_features
 

Detailed Description

zsh module glue: builtins table, features, and lifecycle hooks.

Definition in file module.c.

Function Documentation

◆ bin_zpdirlist()

int bin_zpdirlist ( char *  nam,
char **  argv,
Options  ops,
int  func 
)

zpdirlist builtin entrypoint

Definition at line 31 of file fs_builtins.c.

References zp_dirlist_core(), zp_icon(), and zwarnnam().

Here is the call graph for this function:

◆ bin_zppathstat()

int bin_zppathstat ( char *  nam,
char **  argv,
Options  ops,
int  func 
)

zppathstat builtin entrypoint

Definition at line 15 of file fs_builtins.c.

References zp_icon(), zp_pathstat_core(), and zwarnnam().

Here is the call graph for this function:

◆ bin_zpreadfile()

int bin_zpreadfile ( char *  nam,
char **  argv,
Options  ops,
int  func 
)

zpreadfile builtin entrypoint

Definition at line 45 of file fs_builtins.c.

References zp_icon(), zp_readfile_core(), and zwarnnam().

Here is the call graph for this function:

◆ boot_()

int boot_ ( UNUSED(Module m)  )

Optional early boot hook (unused).

Definition at line 54 of file module.c.

◆ cleanup_()

int cleanup_ ( Module  m)

Cleanup features when unloading.

Definition at line 56 of file module.c.

References module_features, and setfeatureenables().

Here is the call graph for this function:

◆ enables_()

int enables_ ( Module  m,
int **  enables 
)

Enable/disable builtins as requested by the shell.

Definition at line 50 of file module.c.

References handlefeatures(), and module_features.

Here is the call graph for this function:

◆ features_()

int features_ ( Module  m,
char ***  features 
)

Provide feature list (builtins) to zsh.

Definition at line 45 of file module.c.

References featuresarray(), and module_features.

Here is the call graph for this function:

◆ finish_()

int finish_ ( UNUSED(Module m)  )

Finalize module: restore original source handlers.

Definition at line 58 of file module.c.

References zp_source_restore_overrides().

Here is the call graph for this function:

◆ setup_()

int setup_ ( UNUSED(Module m)  )

Module setup: initialize option mapping and install source overrides.

Definition at line 34 of file module.c.

References zp_setup_options_table(), and zp_source_setup_overrides().

Here is the call graph for this function:

Variable Documentation

◆ bintab

struct builtin bintab[]
static
Initial value:
= {
BUILTIN("readarray", 0, bin_readarray, 1, 1, 0, "d:n:O:s:tu:C:c:h", NULL),
BUILTIN("zppathstat", 0, bin_zppathstat, 2, 2, 0, "Lf:", NULL),
BUILTIN("zpdirlist", 0, bin_zpdirlist, 2, 2, 0, "adf", NULL),
BUILTIN("zpreadfile", 0, bin_zpreadfile, 2, 2, 0, "md:0", NULL),
BUILTIN("zpmod", 0, bin_zpmod, 0, -1, 0, "hV", NULL),
}
int bin_zpdirlist(char *nam, char **argv, Options ops, int func)
zpdirlist builtin entrypoint
Definition: fs_builtins.c:31
int bin_zppathstat(char *nam, char **argv, Options ops, int func)
zppathstat builtin entrypoint
Definition: fs_builtins.c:15
int bin_zpreadfile(char *nam, char **argv, Options ops, int func)
zpreadfile builtin entrypoint
Definition: fs_builtins.c:45
int bin_readarray(char *nam, char **argv, Options ops, int func)
readarray builtin entrypoint
Definition: readarray.c:26
int bin_zpmod(char *nam, char **argv, Options ops, int func)

Definition at line 15 of file module.c.

◆ module_features

struct features module_features
static
Initial value:
= {
bintab, (int)(sizeof(bintab) / sizeof(*bintab)), NULL, 0, NULL, 0, NULL, 0,
0}
static struct builtin bintab[]
Definition: module.c:18

Definition at line 15 of file module.c.

Referenced by cleanup_(), enables_(), and features_().