about summary refs log tree commit diff
path: root/Src/parse.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-03-14 11:14:54 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-03-14 11:14:54 +0000
commit05b1db3387e8c54368e43b5c5169fb7daab25c54 (patch)
treef82d1a236bfe25634666ca2782e398258b3c8c14 /Src/parse.c
parente91bdf82c9c7b9589bfd813cd7f571d50090f05b (diff)
downloadzsh-05b1db3387e8c54368e43b5c5169fb7daab25c54.tar.gz
zsh-05b1db3387e8c54368e43b5c5169fb7daab25c54.tar.xz
zsh-05b1db3387e8c54368e43b5c5169fb7daab25c54.zip
zsh-workers/10129
Diffstat (limited to 'Src/parse.c')
-rw-r--r--Src/parse.c27
1 files changed, 27 insertions, 0 deletions
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;
+}