Lines Matching refs:header

45         Namarr_t        header;
55 Namarr_t header;
141 struct index_array *aq = (struct index_array*)ap->header.scope;
142 if(!ap->header.fun && aq)
144 return (ap->header.fixed || ((ap->cur<aq->maxi) && aq->val[ap->cur].cp));
157 while(*fp && *fp!= &old->header.hdr)
161 new->header.hdr.next = (*fp)->next;
162 *fp = &new->header.hdr;
282 ap->header.nelem &= ~ARRAY_NOSCOPE;
284 ap->header.nelem |= ARRAY_NOSCOPE;
285 if(wasundef = ap->header.nelem&ARRAY_UNDEF)
287 ap->header.nelem &= ~ARRAY_UNDEF;
292 nv_putsub(np, NIL(char*), ARRAY_SCAN|ARRAY_NOSCOPE|(ap->header.fixed?(ARRAY_UNDEF|ARRAY_FIXED):0));
296 ap->header.nelem |= ARRAY_SCAN;
301 (*ap->header.fun)(np,"0",flag==ARRAY_ASSIGN?NV_AADD:0);
334 ap->header.nelem++;
343 char *data = array_fixed_data((Namarr_t*)ap->header.scope);
352 array_fixed_setdata(np,&ap->header,fp);
357 array_fixed_setdata(np,&ap->header,fp);
367 if(!(ap->header.nelem&ARRAY_SCAN) && ap->cur >= ap->maxi)
375 if(!ap->header.table)
376 ap->header.table = dtopen(&_Nvdisc,Dtoset);
379 mp = nv_search(cp, ap->header.table, NV_ADD);
397 ap->header.nelem++;
546 aq->header.nelem |= ARRAY_NOSCOPE;
556 aq->header.nelem = ap->nelem = nelem;
831 ap->header = arp->header;
832 ap->header.hdr.dsize = sizeof(*ap) + i;
845 ap->header.hdr.dsize = sizeof(*ap) + i;
847 ap->header.fun = 0;
857 ap->header.table = dtopen(&_Nvdisc,Dtoset);
858 mp = nv_search("0", ap->header.table,NV_ADD);
878 ap->header.nelem = i;
879 ap->header.hdr.disc = &array_disc;
885 ap->header.hdr.nofree &= ~1;
1081 if(!ap || !(ap->header.nelem&ARRAY_SCAN))
1085 if((*ap->header.fun)(np,NIL(char*),NV_ANEXT))
1087 ap->header.nelem &= ~(ARRAY_SCAN|ARRAY_NOCHILD);
1091 else if(fp = (struct fixed_array*)ap->header.fixed)
1093 if(ap->header.nelem&ARRAY_FIXED)
1101 ap->header.nelem &= ~ARRAY_FIXED;
1121 ap->header.nelem &= ~(ARRAY_SCAN|ARRAY_NOCHILD);
1125 if(!(ap->header.nelem&ARRAY_NOSCOPE))
1126 ar = (struct index_array*)ap->header.scope;
1130 if(!ap->val[dot].cp && !(ap->header.nelem&ARRAY_NOSCOPE))
1135 if(aq->val[dot].cp==Empty && array_elem(&aq->header) < nv_aimax(np)+1) {
1146 if((aq->header.nelem&ARRAY_NOCHILD) && nv_isvtree(mp) && !mp->nvfun->dsize)
1154 ap->header.nelem &= ~(ARRAY_SCAN|ARRAY_NOCHILD);
1176 if(!ap || (!ap->header.fixed && !ap->header.fun))
1178 if(!ap || !ap->header.fun)
1208 ap->header.nelem &= ~ARRAY_UNDEF;
1209 ap->header.nelem |= (mode&(ARRAY_SCAN|ARRAY_NOCHILD|ARRAY_UNDEF|ARRAY_NOSCOPE));
1238 ap->header.nelem = 0;
1246 ap->header.nelem++;
1256 if(ap->header.nelem&ARRAY_TREE)
1260 if(!ap->header.table)
1261 ap->header.table = dtopen(&_Nvdisc,Dtoset);
1264 mp = nv_search(cp, ap->header.table, NV_ADD);
1272 ap->header.nelem++;
1277 ap->header.nelem &= ~ARRAY_SCAN;
1286 if(fp=(struct fixed_array*)ap->header.fixed)
1296 ap->header.nelem &= ~ARRAY_MASK;
1300 ap->header.nelem |= (ARRAY_FIXED|fp->nelem);
1303 ap->header.nelem |= fp->max[0];
1316 fp->dim = ap->header.nelem;
1317 ap->header.nelem |= ARRAY_FIXED;
1326 ap->header.nelem &= ~ARRAY_UNDEF;
1328 ap->header.nelem &= ~ARRAY_SCAN;
1329 ap->header.nelem |= (mode&(ARRAY_SCAN|ARRAY_NOCHILD|ARRAY_UNDEF|ARRAY_NOSCOPE));
1339 (*ap->header.fun)(np, sp, NV_ASETSUB);
1342 (*ap->header.fun)(np, sp, (mode&ARRAY_ADD)?NV_AADD:0);
1343 if(!(mode&(ARRAY_SCAN|ARRAY_ADD)) && !(*ap->header.fun)(np,NIL(char*),NV_ACURRENT))
1347 (*ap->header.fun)(np,(char*)np,0);
1349 (*ap->header.fun)(np, "",0);
1570 return((Namval_t*)((*ap->header.fun)(np,NIL(char*),NV_ACURRENT)));
1572 else if(!(fp=(struct fixed_array*)ap->header.fixed) && array_isbit(ap->bits,ap->cur,ARRAY_CHILD))
1586 if(ap->header.nelem&ARRAY_SCAN)
1609 return((char*)((*ap->header.fun)(np,NIL(char*),NV_ANAME)));
1654 if(!ap || is_associative(&ap->header) || ap->header.fixed)
1656 if(!ap || is_associative(&ap->header))
1676 ap->header.table = dtopen(&_Nvdisc,Dtoset);
1679 ap->header.hdr.disc = &array_disc;
1681 ap->header.hdr.dsize = sizeof(struct assoc_array);
1682 ap->header.hdr.nofree &= ~1;
1688 if(!ap->header.scope || (Dt_t*)ap->header.scope==ap->header.table || !nv_search(ap->cur->nvname,(Dt_t*)ap->header.scope,0))
1689 ap->header.nelem--;
1691 nv_delete(ap->cur,ap->header.table,0);
1697 if(ap->header.scope)
1699 ap->header.table = dtview(ap->header.table,(Dt_t*)0);
1700 dtclose(ap->header.scope);
1701 ap->header.scope = 0;
1704 dtclose(ap->header.table);
1709 if((ap->header.nelem&ARRAY_NOSCOPE) && ap->header.scope && dtvnext(ap->header.table))
1711 ap->header.scope = dtvnext(ap->header.table);
1712 ap->header.table->view = 0;
1715 ap->pos = (Namval_t*)dtfirst(ap->header.table);
1721 ap->nextpos = (Namval_t*)dtnext(ap->header.table,ap->pos);
1724 if((ap->header.nelem&ARRAY_NOCHILD) && nv_isattr(ap->cur,NV_CHILD))
1729 if((ap->header.nelem&ARRAY_NOSCOPE) && ap->header.scope && !dtvnext(ap->header.table))
1731 ap->header.table->view = (Dt_t*)ap->header.scope;
1732 ap->header.scope = ap->header.table;
1761 else if(ap->header.nelem&ARRAY_NOSCOPE)
1765 if(sh.subshell && (mp=nv_search(sp,ap->header.table,0)) && nv_isnull(mp))
1767 if((mp || (mp=nv_search(sp,ap->header.table,mode))) && nv_isnull(mp) && (mode&NV_ADD))
1775 if(!ap->header.scope || !nv_search(sp,dtvnext(ap->header.table),0))
1776 ap->header.nelem++;
1779 if(ap->header.nelem&ARRAY_TREE)
1784 else if(ap->header.nelem&ARRAY_SCAN)
1788 ap->pos = mp = (Namval_t*)dtprev(ap->header.table,&fake);
1789 ap->nextpos = (Namval_t*)dtnext(ap->header.table,mp);
1792 mp = nv_search(sp,ap->header.table,NV_ADD|HASH_NOSCOPE);
1795 ap->header.nelem |= ARRAY_SCAN;
1796 else if(!(ap->header.nelem&ARRAY_SCAN))
1824 if(!(aq = (struct index_array*)ap->header.scope))