Skip to main content

Module example

Module example 

Source
Expand description

zsh/example module — port of Src/Modules/example.c.

Top-level declaration order matches C source line-by-line:

  • static zlong intparam; c:35
  • static char *strparam; c:36
  • static char **arrparam; c:37
  • bin_example(nam, args, ops, func) c:42
  • cond_p_len(a, id) c:80
  • cond_i_ex(a, id) c:95
  • math_sum(name, argc, argv, id) c:104
  • math_length(name, arg, id) c:133
  • ex_wrapper(prog, w, name) c:145
  • static struct builtin bintab[] c:164
  • static struct conddef cotab[] c:168
  • static struct paramdef patab[] c:173
  • static struct mathfunc mftab[] c:179
  • static struct funcwrap wrapper[] c:184
  • static struct features module_features c:188
  • setup_(m) c:198
  • features_(m, features) c:207
  • enables_(m, enables) c:215
  • boot_(m) c:222
  • cleanup_(m) c:235
  • finish_(m) c:243

Statics§

arrparam
Port of static char **arrparam; from Src/Modules/example.c:37. Bound to the exarr array paramdef at c:174. None mirrors C’s initial NULL.
intparam
Port of static zlong intparam; from Src/Modules/example.c:35. Bound to the exint integer paramdef at c:175.
strparam
Port of static char *strparam; from Src/Modules/example.c:36. Bound to the exstr string paramdef at c:176. None mirrors C’s initial NULL which bin_example prints as the empty string at c:63.

Functions§

bin_example
Port of bin_example(char *nam, char **args, Options ops, UNUSED(int func)) from Src/Modules/example.c:42.
boot_
Port of boot_(UNUSED(Module m)) from Src/Modules/example.c:222. C body sets the demo paramdef-bound statics then calls addwrapper(m, wrapper).
cleanup_
Port of cleanup_(UNUSED(Module m)) from Src/Modules/example.c:235. C body: deletewrapper(m, wrapper); return setfeatureenables(m, &module_features, NULL);
cond_i_ex
Port of cond_i_ex(char **a, UNUSED(int id)) from Src/Modules/example.c:95.
cond_p_len
Port of cond_p_len(char **a, UNUSED(int id)) from Src/Modules/example.c:80.
enables_
Port of enables_(UNUSED(Module m), UNUSED(int **enables)) from Src/Modules/example.c:215. C body: return handlefeatures(m, &module_features, enables);
ex_wrapper
Port of ex_wrapper(Eprog prog, FuncWrap w, char *name) from Src/Modules/example.c:145.
features_
Port of features_(UNUSED(Module m), UNUSED(char ***features)) from Src/Modules/example.c:207. C body: *features = featuresarray(m, &module_features); return 0;
finish_
Port of finish_(UNUSED(Module m)) from Src/Modules/example.c:243.
math_length
Port of math_length(UNUSED(char *name), char *arg, UNUSED(int id)) from Src/Modules/example.c:133.
math_sum
Port of math_sum(UNUSED(char *name), int argc, mnumber *argv, UNUSED(int id)) from Src/Modules/example.c:104.
setup_
Port of setup_(UNUSED(Module m)) from Src/Modules/example.c:198.