| 132 | } |
| 133 | } |
| 134 | lists lCopy_newstruct(lists L) |
| 135 | { |
| 136 | lists N=(lists)omAlloc0Bin(slists_bin); |
| 137 | int n=L->nr; |
| 138 | ring save_ring=currRing; |
| 139 | N->Init(n+1); |
| 140 | for(;n>=0;n--) |
| 141 | { |
| 142 | if (RingDependend(L->m[n].rtyp) |
| 143 | ||((L->m[n].rtyp==LIST_CMD)&&lRingDependend((lists)L->m[n].data))) |
| 144 | { |
| 145 | assume((L->m[n-1].rtyp==RING_CMD) || (L->m[n-1].data==NULL)); |
| 146 | if(L->m[n-1].data!=NULL) |
| 147 | { |
| 148 | if (L->m[n-1].data!=(void*)currRing) |
| 149 | rChangeCurrRing((ring)(L->m[n-1].data)); |
| 150 | N->m[n].Copy(&L->m[n]); |
| 151 | } |
| 152 | else |
| 153 | { |
| 154 | N->m[n].rtyp=L->m[n].rtyp; |
| 155 | N->m[n].data=idrecDataInit(L->m[n].rtyp); |
| 156 | } |
| 157 | } |
| 158 | else if(L->m[n].rtyp==LIST_CMD) |
| 159 | { |
| 160 | N->m[n].rtyp=L->m[n].rtyp; |
| 161 | N->m[n].data=(void *)lCopy((lists)(L->m[n].data)); |
| 162 | } |
| 163 | else if(L->m[n].rtyp>MAX_TOK) |
| 164 | { |
| 165 | N->m[n].rtyp=L->m[n].rtyp; |
| 166 | blackbox *b=getBlackboxStuff(N->m[n].rtyp); |
| 167 | N->m[n].data=(void *)b->blackbox_Copy(b,L->m[n].data); |
| 168 | } |
| 169 | else |
| 170 | N->m[n].Copy(&L->m[n]); |
| 171 | } |
| 172 | if (currRing!=save_ring) rChangeCurrRing(save_ring); |
| 173 | return N; |
| 174 | } |
| 175 | void * newstruct_Copy(blackbox*, void *d) |
| 176 | { |
| 177 | lists n1=(lists)d; |
no test coverage detected