ksh: Remove symbol clash with libc Rename local function twalk() to ksh_twak(). This is needed for installing interceptors in sanitizers. Sponsored by <The NetBSD Foundation>diff -r1.28 -r1.29 src/bin/ksh/c_ksh.c
(kamil)
--- src/bin/ksh/c_ksh.c 2018/05/08 16:37:59 1.28
+++ src/bin/ksh/c_ksh.c 2018/06/03 12:18:29 1.29
@@ -1,22 +1,22 @@ | @@ -1,22 +1,22 @@ | |||
1 | /* $NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $ */ | 1 | /* $NetBSD: c_ksh.c,v 1.29 2018/06/03 12:18:29 kamil Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * built-in Korn commands: c_* | 4 | * built-in Korn commands: c_* | |
5 | */ | 5 | */ | |
6 | #include <sys/cdefs.h> | 6 | #include <sys/cdefs.h> | |
7 | 7 | |||
8 | #ifndef lint | 8 | #ifndef lint | |
9 | __RCSID("$NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $"); | 9 | __RCSID("$NetBSD: c_ksh.c,v 1.29 2018/06/03 12:18:29 kamil Exp $"); | |
10 | #endif | 10 | #endif | |
11 | 11 | |||
12 | #include <sys/stat.h> | 12 | #include <sys/stat.h> | |
13 | #include <ctype.h> | 13 | #include <ctype.h> | |
14 | 14 | |||
15 | #include "sh.h" | 15 | #include "sh.h" | |
16 | 16 | |||
17 | int | 17 | int | |
18 | c_cd(wp) | 18 | c_cd(wp) | |
19 | char **wp; | 19 | char **wp; | |
20 | { | 20 | { | |
21 | int optc; | 21 | int optc; | |
22 | int physical = Flag(FPHYSICAL); | 22 | int physical = Flag(FPHYSICAL); | |
@@ -1022,27 +1022,27 @@ c_unalias(wp) | @@ -1022,27 +1022,27 @@ c_unalias(wp) | |||
1022 | rv = 1; /* POSIX */ | 1022 | rv = 1; /* POSIX */ | |
1023 | continue; | 1023 | continue; | |
1024 | } | 1024 | } | |
1025 | if (ap->flag&ALLOC) { | 1025 | if (ap->flag&ALLOC) { | |
1026 | ap->flag &= ~(ALLOC|ISSET); | 1026 | ap->flag &= ~(ALLOC|ISSET); | |
1027 | afree((void*)ap->val.s, APERM); | 1027 | afree((void*)ap->val.s, APERM); | |
1028 | } | 1028 | } | |
1029 | ap->flag &= ~(DEFINED|ISSET|EXPORT); | 1029 | ap->flag &= ~(DEFINED|ISSET|EXPORT); | |
1030 | } | 1030 | } | |
1031 | 1031 | |||
1032 | if (all) { | 1032 | if (all) { | |
1033 | struct tstate ts; | 1033 | struct tstate ts; | |
1034 | 1034 | |||
1035 | for (twalk(&ts, t); (ap = tnext(&ts)); ) { | 1035 | for (ksh_twalk(&ts, t); (ap = tnext(&ts)); ) { | |
1036 | if (ap->flag&ALLOC) { | 1036 | if (ap->flag&ALLOC) { | |
1037 | ap->flag &= ~(ALLOC|ISSET); | 1037 | ap->flag &= ~(ALLOC|ISSET); | |
1038 | afree((void*)ap->val.s, APERM); | 1038 | afree((void*)ap->val.s, APERM); | |
1039 | } | 1039 | } | |
1040 | ap->flag &= ~(DEFINED|ISSET|EXPORT); | 1040 | ap->flag &= ~(DEFINED|ISSET|EXPORT); | |
1041 | } | 1041 | } | |
1042 | } | 1042 | } | |
1043 | 1043 | |||
1044 | return rv; | 1044 | return rv; | |
1045 | } | 1045 | } | |
1046 | 1046 | |||
1047 | #ifdef KSH | 1047 | #ifdef KSH | |
1048 | int | 1048 | int |
--- src/bin/ksh/edit.c 2017/07/01 23:12:08 1.34
+++ src/bin/ksh/edit.c 2018/06/03 12:18:29 1.35
@@ -1,23 +1,23 @@ | @@ -1,23 +1,23 @@ | |||
1 | /* $NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $ */ | 1 | /* $NetBSD: edit.c,v 1.35 2018/06/03 12:18:29 kamil Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Command line editing - common code | 4 | * Command line editing - common code | |
5 | * | 5 | * | |
6 | */ | 6 | */ | |
7 | #include <sys/cdefs.h> | 7 | #include <sys/cdefs.h> | |
8 | 8 | |||
9 | #ifndef lint | 9 | #ifndef lint | |
10 | __RCSID("$NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $"); | 10 | __RCSID("$NetBSD: edit.c,v 1.35 2018/06/03 12:18:29 kamil Exp $"); | |
11 | #endif | 11 | #endif | |
12 | 12 | |||
13 | #include <stdbool.h> | 13 | #include <stdbool.h> | |
14 | 14 | |||
15 | #include "config.h" | 15 | #include "config.h" | |
16 | #ifdef EDIT | 16 | #ifdef EDIT | |
17 | 17 | |||
18 | #include "sh.h" | 18 | #include "sh.h" | |
19 | #include "tty.h" | 19 | #include "tty.h" | |
20 | #define EXTERN | 20 | #define EXTERN | |
21 | #include "edit.h" | 21 | #include "edit.h" | |
22 | #undef EXTERN | 22 | #undef EXTERN | |
23 | #include <sys/ioctl.h> | 23 | #include <sys/ioctl.h> | |
@@ -928,27 +928,27 @@ x_basename(s, se) | @@ -928,27 +928,27 @@ x_basename(s, se) | |||
928 | /* | 928 | /* | |
929 | * Apply pattern matching to a table: all table entries that match a pattern | 929 | * Apply pattern matching to a table: all table entries that match a pattern | |
930 | * are added to wp. | 930 | * are added to wp. | |
931 | */ | 931 | */ | |
932 | static void | 932 | static void | |
933 | glob_table(pat, wp, tp) | 933 | glob_table(pat, wp, tp) | |
934 | const char *pat; | 934 | const char *pat; | |
935 | XPtrV *wp; | 935 | XPtrV *wp; | |
936 | struct table *tp; | 936 | struct table *tp; | |
937 | { | 937 | { | |
938 | struct tstate ts; | 938 | struct tstate ts; | |
939 | struct tbl *te; | 939 | struct tbl *te; | |
940 | 940 | |||
941 | for (twalk(&ts, tp); (te = tnext(&ts)); ) { | 941 | for (ksh_twalk(&ts, tp); (te = tnext(&ts)); ) { | |
942 | if (gmatch(te->name, pat, false)) | 942 | if (gmatch(te->name, pat, false)) | |
943 | XPput(*wp, str_save(te->name, ATEMP)); | 943 | XPput(*wp, str_save(te->name, ATEMP)); | |
944 | } | 944 | } | |
945 | } | 945 | } | |
946 | 946 | |||
947 | static void | 947 | static void | |
948 | glob_path(flags, pat, wp, xpath) | 948 | glob_path(flags, pat, wp, xpath) | |
949 | int flags; | 949 | int flags; | |
950 | const char *pat; | 950 | const char *pat; | |
951 | XPtrV *wp; | 951 | XPtrV *wp; | |
952 | const char *xpath; | 952 | const char *xpath; | |
953 | { | 953 | { | |
954 | const char *sp, *p; | 954 | const char *sp, *p; |
--- src/bin/ksh/exec.c 2018/05/08 16:37:59 1.27
+++ src/bin/ksh/exec.c 2018/06/03 12:18:29 1.28
@@ -1,22 +1,22 @@ | @@ -1,22 +1,22 @@ | |||
1 | /* $NetBSD: exec.c,v 1.27 2018/05/08 16:37:59 kamil Exp $ */ | 1 | /* $NetBSD: exec.c,v 1.28 2018/06/03 12:18:29 kamil Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * execute command tree | 4 | * execute command tree | |
5 | */ | 5 | */ | |
6 | #include <sys/cdefs.h> | 6 | #include <sys/cdefs.h> | |
7 | 7 | |||
8 | #ifndef lint | 8 | #ifndef lint | |
9 | __RCSID("$NetBSD: exec.c,v 1.27 2018/05/08 16:37:59 kamil Exp $"); | 9 | __RCSID("$NetBSD: exec.c,v 1.28 2018/06/03 12:18:29 kamil Exp $"); | |
10 | #endif | 10 | #endif | |
11 | 11 | |||
12 | #include <sys/stat.h> | 12 | #include <sys/stat.h> | |
13 | #include <ctype.h> | 13 | #include <ctype.h> | |
14 | #include <stdbool.h> | 14 | #include <stdbool.h> | |
15 | 15 | |||
16 | #include "sh.h" | 16 | #include "sh.h" | |
17 | #include "c_test.h" | 17 | #include "c_test.h" | |
18 | 18 | |||
19 | /* Does ps4 get parameter substitutions done? */ | 19 | /* Does ps4 get parameter substitutions done? */ | |
20 | #ifdef KSH | 20 | #ifdef KSH | |
21 | # define PS4_SUBSTITUTE(s) substitute((s), 0) | 21 | # define PS4_SUBSTITUTE(s) substitute((s), 0) | |
22 | #else | 22 | #else | |
@@ -989,27 +989,27 @@ findcom(name, flags) | @@ -989,27 +989,27 @@ findcom(name, flags) | |||
989 | return tp; | 989 | return tp; | |
990 | } | 990 | } | |
991 | 991 | |||
992 | /* | 992 | /* | |
993 | * flush executable commands with relative paths | 993 | * flush executable commands with relative paths | |
994 | */ | 994 | */ | |
995 | void | 995 | void | |
996 | flushcom(all) | 996 | flushcom(all) | |
997 | int all; /* just relative or all */ | 997 | int all; /* just relative or all */ | |
998 | { | 998 | { | |
999 | struct tbl *tp; | 999 | struct tbl *tp; | |
1000 | struct tstate ts; | 1000 | struct tstate ts; | |
1001 | 1001 | |||
1002 | for (twalk(&ts, &taliases); (tp = tnext(&ts)) != NULL; ) | 1002 | for (ksh_twalk(&ts, &taliases); (tp = tnext(&ts)) != NULL; ) | |
1003 | if ((tp->flag&ISSET) && (all || !ISDIRSEP(tp->val.s[0]))) { | 1003 | if ((tp->flag&ISSET) && (all || !ISDIRSEP(tp->val.s[0]))) { | |
1004 | if (tp->flag&ALLOC) { | 1004 | if (tp->flag&ALLOC) { | |
1005 | tp->flag &= ~(ALLOC|ISSET); | 1005 | tp->flag &= ~(ALLOC|ISSET); | |
1006 | afree(tp->val.s, APERM); | 1006 | afree(tp->val.s, APERM); | |
1007 | } | 1007 | } | |
1008 | tp->flag &= ~ISSET; | 1008 | tp->flag &= ~ISSET; | |
1009 | } | 1009 | } | |
1010 | } | 1010 | } | |
1011 | 1011 | |||
1012 | /* Check if path is something we want to find. Returns -1 for failure. */ | 1012 | /* Check if path is something we want to find. Returns -1 for failure. */ | |
1013 | int | 1013 | int | |
1014 | search_access(pathx, mode, errnop) | 1014 | search_access(pathx, mode, errnop) | |
1015 | const char *pathx; | 1015 | const char *pathx; |
--- src/bin/ksh/proto.h 2018/01/24 09:53:21 1.12
+++ src/bin/ksh/proto.h 2018/06/03 12:18:29 1.13
@@ -1,19 +1,19 @@ | @@ -1,19 +1,19 @@ | |||
1 | /* $NetBSD: proto.h,v 1.12 2018/01/24 09:53:21 kamil Exp $ */ | 1 | /* $NetBSD: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * prototypes for PD-KSH | 4 | * prototypes for PD-KSH | |
5 | * originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang " | 5 | * originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang " | |
6 | * $Id: proto.h,v 1.12 2018/01/24 09:53:21 kamil Exp $ | 6 | * $Id: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $ | |
7 | */ | 7 | */ | |
8 | 8 | |||
9 | #include <stdbool.h> | 9 | #include <stdbool.h> | |
10 | 10 | |||
11 | /* alloc.c */ | 11 | /* alloc.c */ | |
12 | Area * ainit ARGS((Area *)); | 12 | Area * ainit ARGS((Area *)); | |
13 | void afreeall ARGS((Area *)); | 13 | void afreeall ARGS((Area *)); | |
14 | void * alloc ARGS((size_t, Area *)); | 14 | void * alloc ARGS((size_t, Area *)); | |
15 | void * aresize ARGS((void *, size_t, Area *)); | 15 | void * aresize ARGS((void *, size_t, Area *)); | |
16 | void afree ARGS((void *, Area *)); | 16 | void afree ARGS((void *, Area *)); | |
17 | /* c_ksh.c */ | 17 | /* c_ksh.c */ | |
18 | int c_hash ARGS((char **)); | 18 | int c_hash ARGS((char **)); | |
19 | int c_cd ARGS((char **)); | 19 | int c_cd ARGS((char **)); | |
@@ -209,27 +209,27 @@ int make_path ARGS((const char *, const | @@ -209,27 +209,27 @@ int make_path ARGS((const char *, const | |||
209 | char **, XString *, int *)); | 209 | char **, XString *, int *)); | |
210 | void simplify_path ARGS((char *)); | 210 | void simplify_path ARGS((char *)); | |
211 | char *get_phys_path ARGS((const char *)); | 211 | char *get_phys_path ARGS((const char *)); | |
212 | void set_current_wd ARGS((char *)); | 212 | void set_current_wd ARGS((char *)); | |
213 | /* syn.c */ | 213 | /* syn.c */ | |
214 | void initkeywords ARGS((void)); | 214 | void initkeywords ARGS((void)); | |
215 | struct op * compile ARGS((Source *)); | 215 | struct op * compile ARGS((Source *)); | |
216 | /* table.c */ | 216 | /* table.c */ | |
217 | unsigned int hash ARGS((const char *)); | 217 | unsigned int hash ARGS((const char *)); | |
218 | void tinit ARGS((struct table *, Area *, int)); | 218 | void tinit ARGS((struct table *, Area *, int)); | |
219 | struct tbl * mytsearch ARGS((struct table *, const char *, unsigned int)); | 219 | struct tbl * mytsearch ARGS((struct table *, const char *, unsigned int)); | |
220 | struct tbl * tenter ARGS((struct table *, const char *, unsigned int)); | 220 | struct tbl * tenter ARGS((struct table *, const char *, unsigned int)); | |
221 | void mytdelete ARGS((struct tbl *)); | 221 | void mytdelete ARGS((struct tbl *)); | |
222 | void twalk ARGS((struct tstate *, struct table *)); | 222 | void ksh_twalk ARGS((struct tstate *, struct table *)); | |
223 | struct tbl * tnext ARGS((struct tstate *)); | 223 | struct tbl * tnext ARGS((struct tstate *)); | |
224 | struct tbl ** tsort ARGS((struct table *)); | 224 | struct tbl ** tsort ARGS((struct table *)); | |
225 | /* trace.c */ | 225 | /* trace.c */ | |
226 | /* trap.c */ | 226 | /* trap.c */ | |
227 | void inittraps ARGS((void)); | 227 | void inittraps ARGS((void)); | |
228 | #ifdef KSH | 228 | #ifdef KSH | |
229 | void alarm_init ARGS((void)); | 229 | void alarm_init ARGS((void)); | |
230 | #endif /* KSH */ | 230 | #endif /* KSH */ | |
231 | Trap * gettrap ARGS((const char *, int)); | 231 | Trap * gettrap ARGS((const char *, int)); | |
232 | RETSIGTYPE trapsig ARGS((int)); | 232 | RETSIGTYPE trapsig ARGS((int)); | |
233 | void intrcheck ARGS((void)); | 233 | void intrcheck ARGS((void)); | |
234 | int fatal_trap_check ARGS((void)); | 234 | int fatal_trap_check ARGS((void)); | |
235 | int trap_pending ARGS((void)); | 235 | int trap_pending ARGS((void)); |
--- src/bin/ksh/table.c 2018/05/08 16:37:59 1.7
+++ src/bin/ksh/table.c 2018/06/03 12:18:29 1.8
@@ -1,22 +1,22 @@ | @@ -1,22 +1,22 @@ | |||
1 | /* $NetBSD: table.c,v 1.7 2018/05/08 16:37:59 kamil Exp $ */ | 1 | /* $NetBSD: table.c,v 1.8 2018/06/03 12:18:29 kamil Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * dynamic hashed associative table for commands and variables | 4 | * dynamic hashed associative table for commands and variables | |
5 | */ | 5 | */ | |
6 | #include <sys/cdefs.h> | 6 | #include <sys/cdefs.h> | |
7 | 7 | |||
8 | #ifndef lint | 8 | #ifndef lint | |
9 | __RCSID("$NetBSD: table.c,v 1.7 2018/05/08 16:37:59 kamil Exp $"); | 9 | __RCSID("$NetBSD: table.c,v 1.8 2018/06/03 12:18:29 kamil Exp $"); | |
10 | #endif | 10 | #endif | |
11 | 11 | |||
12 | 12 | |||
13 | #include "sh.h" | 13 | #include "sh.h" | |
14 | 14 | |||
15 | #define INIT_TBLS 8 /* initial table size (power of 2) */ | 15 | #define INIT_TBLS 8 /* initial table size (power of 2) */ | |
16 | 16 | |||
17 | static void texpand ARGS((struct table *tp, int nsize)); | 17 | static void texpand ARGS((struct table *tp, int nsize)); | |
18 | static int tnamecmp ARGS((void *p1, void *p2)); | 18 | static int tnamecmp ARGS((void *p1, void *p2)); | |
19 | 19 | |||
20 | 20 | |||
21 | unsigned int | 21 | unsigned int | |
22 | hash(n) | 22 | hash(n) | |
@@ -141,27 +141,27 @@ tenter(tp, n, h) | @@ -141,27 +141,27 @@ tenter(tp, n, h) | |||
141 | tp->nfree--; | 141 | tp->nfree--; | |
142 | *pp = p; | 142 | *pp = p; | |
143 | return p; | 143 | return p; | |
144 | } | 144 | } | |
145 | 145 | |||
146 | void | 146 | void | |
147 | mytdelete(p) | 147 | mytdelete(p) | |
148 | struct tbl *p; | 148 | struct tbl *p; | |
149 | { | 149 | { | |
150 | p->flag = 0; | 150 | p->flag = 0; | |
151 | } | 151 | } | |
152 | 152 | |||
153 | void | 153 | void | |
154 | twalk(ts, tp) | 154 | ksh_twalk(ts, tp) | |
155 | struct tstate *ts; | 155 | struct tstate *ts; | |
156 | struct table *tp; | 156 | struct table *tp; | |
157 | { | 157 | { | |
158 | ts->left = tp->size; | 158 | ts->left = tp->size; | |
159 | ts->next = tp->tbls; | 159 | ts->next = tp->tbls; | |
160 | } | 160 | } | |
161 | 161 | |||
162 | struct tbl * | 162 | struct tbl * | |
163 | tnext(ts) | 163 | tnext(ts) | |
164 | struct tstate *ts; | 164 | struct tstate *ts; | |
165 | { | 165 | { | |
166 | while (--ts->left >= 0) { | 166 | while (--ts->left >= 0) { | |
167 | struct tbl *p = *ts->next++; | 167 | struct tbl *p = *ts->next++; | |
@@ -206,27 +206,27 @@ void | @@ -206,27 +206,27 @@ void | |||
206 | tprintinfo(tp) | 206 | tprintinfo(tp) | |
207 | struct table *tp; | 207 | struct table *tp; | |
208 | { | 208 | { | |
209 | struct tbl *te; | 209 | struct tbl *te; | |
210 | char *n; | 210 | char *n; | |
211 | unsigned int h; | 211 | unsigned int h; | |
212 | int ncmp; | 212 | int ncmp; | |
213 | int totncmp = 0, maxncmp = 0; | 213 | int totncmp = 0, maxncmp = 0; | |
214 | int nentries = 0; | 214 | int nentries = 0; | |
215 | struct tstate ts; | 215 | struct tstate ts; | |
216 | 216 | |||
217 | shellf("table size %d, nfree %d\n", tp->size, tp->nfree); | 217 | shellf("table size %d, nfree %d\n", tp->size, tp->nfree); | |
218 | shellf(" Ncmp name\n"); | 218 | shellf(" Ncmp name\n"); | |
219 | twalk(&ts, tp); | 219 | ksh_twalk(&ts, tp); | |
220 | while ((te = tnext(&ts))) { | 220 | while ((te = tnext(&ts))) { | |
221 | struct tbl **pp, *p; | 221 | struct tbl **pp, *p; | |
222 | 222 | |||
223 | h = hash(n = te->name); | 223 | h = hash(n = te->name); | |
224 | ncmp = 0; | 224 | ncmp = 0; | |
225 | 225 | |||
226 | /* taken from mytsearch() and added counter */ | 226 | /* taken from mytsearch() and added counter */ | |
227 | for (pp = &tp->tbls[h & (tp->size-1)]; (p = *pp); pp--) { | 227 | for (pp = &tp->tbls[h & (tp->size-1)]; (p = *pp); pp--) { | |
228 | ncmp++; | 228 | ncmp++; | |
229 | if (*p->name == *n && strcmp(p->name, n) == 0 | 229 | if (*p->name == *n && strcmp(p->name, n) == 0 | |
230 | && (p->flag&DEFINED)) | 230 | && (p->flag&DEFINED)) | |
231 | break; /* return p; */ | 231 | break; /* return p; */ | |
232 | if (pp == tp->tbls) /* wrap */ | 232 | if (pp == tp->tbls) /* wrap */ |
--- src/bin/ksh/table.h 1999/10/20 15:10:00 1.3
+++ src/bin/ksh/table.h 2018/06/03 12:18:29 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: table.h,v 1.3 1999/10/20 15:10:00 hubertf Exp $ */ | 1 | /* $NetBSD: table.h,v 1.4 2018/06/03 12:18:29 kamil Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * generic hashed associative table for commands and variables. | 4 | * generic hashed associative table for commands and variables. | |
5 | */ | 5 | */ | |
6 | 6 | |||
7 | struct table { | 7 | struct table { | |
8 | Area *areap; /* area to allocate entries */ | 8 | Area *areap; /* area to allocate entries */ | |
9 | short size, nfree; /* hash size (always 2^^n), free entries */ | 9 | short size, nfree; /* hash size (always 2^^n), free entries */ | |
10 | struct tbl **tbls; /* hashed table items */ | 10 | struct tbl **tbls; /* hashed table items */ | |
11 | }; | 11 | }; | |
12 | 12 | |||
13 | struct tbl { /* table item */ | 13 | struct tbl { /* table item */ | |
14 | Tflag flag; /* flags */ | 14 | Tflag flag; /* flags */ | |
@@ -117,27 +117,27 @@ struct block { | @@ -117,27 +117,27 @@ struct block { | |||
117 | #if 1 | 117 | #if 1 | |
118 | char * error; /* error handler */ | 118 | char * error; /* error handler */ | |
119 | char * exit; /* exit handler */ | 119 | char * exit; /* exit handler */ | |
120 | #else | 120 | #else | |
121 | Trap error, exit; | 121 | Trap error, exit; | |
122 | #endif | 122 | #endif | |
123 | struct block *next; /* enclosing block */ | 123 | struct block *next; /* enclosing block */ | |
124 | }; | 124 | }; | |
125 | 125 | |||
126 | /* Values for struct block.flags */ | 126 | /* Values for struct block.flags */ | |
127 | #define BF_DOGETOPTS BIT(0) /* save/restore getopts state */ | 127 | #define BF_DOGETOPTS BIT(0) /* save/restore getopts state */ | |
128 | 128 | |||
129 | /* | 129 | /* | |
130 | * Used by twalk() and tnext() routines. | 130 | * Used by ksh_twalk() and tnext() routines. | |
131 | */ | 131 | */ | |
132 | struct tstate { | 132 | struct tstate { | |
133 | int left; | 133 | int left; | |
134 | struct tbl **next; | 134 | struct tbl **next; | |
135 | }; | 135 | }; | |
136 | 136 | |||
137 | 137 | |||
138 | EXTERN struct table taliases; /* tracked aliases */ | 138 | EXTERN struct table taliases; /* tracked aliases */ | |
139 | EXTERN struct table builtins; /* built-in commands */ | 139 | EXTERN struct table builtins; /* built-in commands */ | |
140 | EXTERN struct table aliases; /* aliases */ | 140 | EXTERN struct table aliases; /* aliases */ | |
141 | EXTERN struct table keywords; /* keywords */ | 141 | EXTERN struct table keywords; /* keywords */ | |
142 | EXTERN struct table homedirs; /* homedir() cache */ | 142 | EXTERN struct table homedirs; /* homedir() cache */ | |
143 | 143 |