From 05b1db3387e8c54368e43b5c5169fb7daab25c54 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 14 Mar 2000 11:14:54 +0000 Subject: zsh-workers/10129 --- Src/parse.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Src/parse.c') diff --git a/Src/parse.c b/Src/parse.c index 373e35ab9..608e68cc7 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -2801,3 +2801,30 @@ decrdumpcount(FuncDump f) } #endif + +/**/ +int +dump_autoload(char *file, int on, char *ops, int func) +{ + Wordcode h; + FDHead n, e; + Shfunc shf; + int ret = 0; + + if (!strsfx(FD_EXT, file)) + file = dyncat(file, FD_EXT); + + if (!(h = load_dump_header(file))) + return 1; + + for (n = firstfdhead(h), e = (FDHead) (h + fdheaderlen(h)); n < e; + n = nextfdhead(n)) { + shf = (Shfunc) zcalloc(sizeof *shf); + shf->flags = on; + shf->funcdef = mkautofn(shf); + shfunctab->addnode(shfunctab, ztrdup(fdname(n) + n->tail), shf); + if (ops['X'] && eval_autoload(shf, shf->nam, ops, func)) + ret = 1; + } + return ret; +} -- cgit 1.4.1