zpmod  b19981f
High-performance Zsh module for script optimization and filesystem helpers
zpmod.pro
Go to the documentation of this file.
1 
5 #ifndef ZPMOD_PRO
6 #define ZPMOD_PRO
7 
8 #include "zpmod_utils.h"
9 #include "zpmod_source.h"
10 #include "zpmod_fpath.h"
11 #include "zpmod_source_hot.h"
12 #include "zpmod_fs.h"
13 
14 /* Builtin handlers */
15 int bin_custom_dot(char *name, char **argv, Options ops, int func);
16 /* readarray builtin (implemented in builtins/readarray.c) */
17 int bin_readarray(char *nam, char **argv, Options ops, int func);
18 
19 /* zpmod command */
20 void zpmod_usage(void);
21 
22 /* zsh module hooks */
23 int setup_(Module m);
24 int features_(Module m, char ***features);
25 int enables_(Module m, int **enables);
26 int boot_(Module m);
27 int cleanup_(Module m);
28 int finish_(Module m);
29 
30 /* Custom helpers used within this module */
31 char *zp_build_source_report(int no_paths, int *rep_size);
32 char *zp_unmetafy_zalloc(const char *to_copy, int *new_len);
33 char *my_ztrdup_glen(const char *s, unsigned *len_ret);
35 
36 /* Builtin command handlers */
37 extern int cmd_dirlist(char *nam, char **argv);
38 extern int cmd_pathstat(char *nam, char **argv);
39 extern int cmd_readfile(char *nam, char **argv);
40 int zp_path_warmup_core(const char *nam, int quiet, int prune_missing, int dry_run);
41 int cmd_source_study(char *nam, char **argv);
42 extern int cmd_fpath_index(char *nam, char **argv);
43 extern int cmd_source_hot(char *nam, char **argv);
44 
45 /* Utility functions */
46 extern char *zp_unmetafy_zalloc(const char *to_copy, int *len);
47 
48 #endif /* ZPMOD_PRO */
int enables_(Module m, int **enables)
Enable/disable builtins as requested by the shell.
Definition: module.c:50
int bin_custom_dot(char *name, char **argv, Options ops, int func)
int boot_(Module m)
int cmd_dirlist(char *nam, char **argv)
int features_(Module m, char ***features)
Provide feature list (builtins) to zsh.
Definition: module.c:45
int cmd_fpath_index(char *nam, char **argv)
Implements zpmod fpath-index with intelligent skip detection.
Definition: fpath.c:57
int zp_path_warmup_core(const char *nam, int quiet, int prune_missing, int dry_run)
Implements path-warmup functionality for executable discovery and path pruning.
Definition: fs.c:254
char * my_ztrdup_glen(const char *s, unsigned *len_ret)
zalloc-backed strdup with length out parameter.
Definition: utils.c:63
int setup_(Module m)
int cmd_source_study(char *nam, char **argv)
int finish_(Module m)
char * zp_unmetafy_zalloc(const char *to_copy, int *new_len)
Duplicate and unmetafy a zsh string with zalloc; see header for details.
Definition: utils.c:76
int cmd_source_hot(char *nam, char **argv)
Implements zpmod source-hot.
Definition: source_hot.c:37
char * zp_build_source_report(int no_paths, int *rep_size)
Definition: source.c:670
void zpmod_usage(void)
Print usage for the zpmod builtin.
Definition: zpmod_builtin.c:96
int cmd_readfile(char *nam, char **argv)
int cleanup_(Module m)
Cleanup features when unloading.
Definition: module.c:56
void zp_freeparamnode(HashNode hn)
int bin_readarray(char *nam, char **argv, Options ops, int func)
readarray builtin entrypoint
Definition: readarray.c:26
int cmd_pathstat(char *nam, char **argv)
void * Module
Filesystem helpers used by builtins and zpmod subcommands.
struct hashnode * HashNode
Public interfaces for source-study and source overrides.
Utility helpers shared across module components.