Changeset 3458 for trunk/src/kash/generated
- Timestamp:
- Sep 14, 2020, 11:46:32 PM (5 years ago)
- Location:
- trunk/src/kash/generated
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/generated/nodes.c
r3449 r3458 51 51 #include "shinstance.h" 52 52 53 #ifndef KASH_SEPARATE_PARSER_ALLOCATOR 53 54 54 55 size_t funcblocksize; /* size of structures in function */ … … 93 94 STATIC char *nodesavestr(char *); 94 95 96 #endif /* !KASH_SEPARATE_PARSER_ALLOCATOR */ 95 97 96 98 … … 104 106 union node *n; 105 107 { 108 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 109 if (n != NULL) { 110 unsigned refs = pstackretain(n->pblock); 111 TRACE2((psh, "copyfunc: %p - %u refs\n", n->pblock, refs)); K_NOREF(refs); 112 } 113 return n; 114 #else 106 115 if (n == NULL) 107 116 return NULL; … … 112 121 funcstring = (char *) funcblock + funcblocksize; 113 122 return copynode(n); 114 } 115 116 123 #endif 124 } 125 126 #ifndef KASH_SEPARATE_PARSER_ALLOCATOR 117 127 118 128 STATIC void … … 274 284 case NAPPEND: 275 285 new->nfile.fname = copynode(n->nfile.fname); 286 new->nfile.next = copynode(n->nfile.next); 276 287 new->nfile.fd = n->nfile.fd; 277 new->nfile.next = copynode(n->nfile.next);278 288 break; 279 289 case NTOFD: … … 281 291 new->ndup.vname = copynode(n->ndup.vname); 282 292 new->ndup.dupfd = n->ndup.dupfd; 293 new->ndup.next = copynode(n->ndup.next); 283 294 new->ndup.fd = n->ndup.fd; 284 new->ndup.next = copynode(n->ndup.next);285 295 break; 286 296 case NHERE: 287 297 case NXHERE: 288 298 new->nhere.doc = copynode(n->nhere.doc); 299 new->nhere.next = copynode(n->nhere.next); 289 300 new->nhere.fd = n->nhere.fd; 290 new->nhere.next = copynode(n->nhere.next);291 301 break; 292 302 case NNOT: … … 335 345 } 336 346 347 #endif /* !KASH_SEPARATE_PARSER_ALLOCATOR */ 337 348 338 349 … … 343 354 void 344 355 freefunc(psh, n) 345 shinstance *psh;356 shinstance *psh; 346 357 union node *n; 347 358 { 359 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 360 if (n) 361 pstackrelease(psh, n->pblock, "freefunc"); 362 #else 348 363 if (n) 349 364 ckfree(psh, n); 350 } 365 #endif 366 } -
trunk/src/kash/generated/nodes.h
r3449 r3458 33 33 34 34 struct nbinary { 35 int type; 36 union node *ch1; 37 union node *ch2; 35 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 36 struct pstack_block *pblock; 37 #endif 38 int type; 39 union node *ch1; 40 union node *ch2; 38 41 }; 39 42 40 43 41 44 struct ncmd { 42 int type; 43 int backgnd; 44 union node *args; 45 union node *redirect; 45 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 46 struct pstack_block *pblock; 47 #endif 48 int type; 49 int backgnd; 50 union node *args; 51 union node *redirect; 46 52 }; 47 53 48 54 49 55 struct npipe { 50 int type; 51 int backgnd; 52 struct nodelist *cmdlist; 56 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 57 struct pstack_block *pblock; 58 #endif 59 int type; 60 int backgnd; 61 struct nodelist *cmdlist; 53 62 }; 54 63 55 64 56 65 struct nredir { 57 int type; 58 union node *n; 59 union node *redirect; 66 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 67 struct pstack_block *pblock; 68 #endif 69 int type; 70 union node *n; 71 union node *redirect; 60 72 }; 61 73 62 74 63 75 struct nif { 64 int type; 65 union node *test; 66 union node *ifpart; 67 union node *elsepart; 76 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 77 struct pstack_block *pblock; 78 #endif 79 int type; 80 union node *test; 81 union node *ifpart; 82 union node *elsepart; 68 83 }; 69 84 70 85 71 86 struct nfor { 72 int type; 73 union node *args; 74 union node *body; 75 char *var; 87 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 88 struct pstack_block *pblock; 89 #endif 90 int type; 91 union node *args; 92 union node *body; 93 char *var; 76 94 }; 77 95 78 96 79 97 struct ncase { 80 int type; 81 union node *expr; 82 union node *cases; 98 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 99 struct pstack_block *pblock; 100 #endif 101 int type; 102 union node *expr; 103 union node *cases; 83 104 }; 84 105 85 106 86 107 struct nclist { 87 int type; 88 union node *next; 89 union node *pattern; 90 union node *body; 108 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 109 struct pstack_block *pblock; 110 #endif 111 int type; 112 union node *next; 113 union node *pattern; 114 union node *body; 91 115 }; 92 116 93 117 94 118 struct narg { 95 int type; 96 union node *next; 97 char *text; 98 struct nodelist *backquote; 119 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 120 struct pstack_block *pblock; 121 #endif 122 int type; 123 union node *next; 124 char *text; 125 struct nodelist *backquote; 99 126 }; 100 127 101 128 102 129 struct nfile { 103 int type; 104 int fd; 105 union node *next; 106 union node *fname; 130 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 131 struct pstack_block *pblock; 132 #endif 133 int type; 134 int fd; 135 union node *next; 136 union node *fname; 107 137 }; 108 138 109 139 110 140 struct ndup { 111 int type; 112 int fd; 113 union node *next; 114 int dupfd; 115 union node *vname; 141 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 142 struct pstack_block *pblock; 143 #endif 144 int type; 145 int fd; 146 union node *next; 147 int dupfd; 148 union node *vname; 116 149 }; 117 150 118 151 119 152 struct nhere { 120 int type; 121 int fd; 122 union node *next; 123 union node *doc; 153 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 154 struct pstack_block *pblock; 155 #endif 156 int type; 157 int fd; 158 union node *next; 159 union node *doc; 124 160 }; 125 161 126 162 127 163 struct nnot { 128 int type; 129 union node *com; 164 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 165 struct pstack_block *pblock; 166 #endif 167 int type; 168 union node *com; 130 169 }; 131 170 132 171 133 172 union node { 134 int type; 135 struct nbinary nbinary; 136 struct ncmd ncmd; 137 struct npipe npipe; 138 struct nredir nredir; 139 struct nif nif; 140 struct nfor nfor; 141 struct ncase ncase; 142 struct nclist nclist; 143 struct narg narg; 144 struct nfile nfile; 145 struct ndup ndup; 146 struct nhere nhere; 147 struct nnot nnot; 173 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 174 # ifdef __GNUC__ 175 __extension__ 176 # endif 177 struct { 178 struct pstack_block *pblock; 179 int type; 180 }; 181 #else 182 int type; 183 #endif 184 struct nbinary nbinary; 185 struct ncmd ncmd; 186 struct npipe npipe; 187 struct nredir nredir; 188 struct nif nif; 189 struct nfor nfor; 190 struct ncase ncase; 191 struct nclist nclist; 192 struct narg narg; 193 struct nfile nfile; 194 struct ndup ndup; 195 struct nhere nhere; 196 struct nnot nnot; 148 197 }; 149 198
Note:
See TracChangeset
for help on using the changeset viewer.