version 1.22, 2011/03/30 02:43:18 |
version 1.24, 2011/07/21 04:43:26 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/poly.c,v 1.21 2003/06/24 09:49:35 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/poly.c,v 1.23 2011/07/20 03:19:11 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 445 void Pp_mag(NODE arg,Q *rp) |
|
Line 445 void Pp_mag(NODE arg,Q *rp) |
|
|
|
void Pord(NODE arg,LIST *listp) |
void Pord(NODE arg,LIST *listp) |
{ |
{ |
NODE n,tn; |
NODE n,tn,p,opt; |
|
char *key; |
|
Obj value; |
|
int overwrite=0; |
LIST l; |
LIST l; |
VL vl,tvl,svl; |
VL vl,tvl,svl; |
P t; |
P t; |
Line 453 void Pord(NODE arg,LIST *listp) |
|
Line 456 void Pord(NODE arg,LIST *listp) |
|
V *va; |
V *va; |
V v; |
V v; |
|
|
|
if ( current_option ) { |
|
for ( opt = current_option; opt; opt = NEXT(opt) ) { |
|
p = BDY((LIST)BDY(opt)); |
|
key = BDY((STRING)BDY(p)); |
|
value = (Obj)BDY(NEXT(p)); |
|
if ( !strcmp(key,"overwrite") && value ) { |
|
overwrite = value ? 1 : 0; |
|
break; |
|
} |
|
} |
|
} |
|
|
if ( argc(arg) ) { |
if ( argc(arg) ) { |
asir_assert(ARG0(arg),O_LIST,"ord"); |
asir_assert(ARG0(arg),O_LIST,"ord"); |
for ( vl = 0, i = 0, n = BDY((LIST)ARG0(arg)); |
for ( vl = 0, i = 0, n = BDY((LIST)ARG0(arg)); |
Line 466 void Pord(NODE arg,LIST *listp) |
|
Line 481 void Pord(NODE arg,LIST *listp) |
|
error("ord : invalid argument"); |
error("ord : invalid argument"); |
VR(tvl) = VR(t); |
VR(tvl) = VR(t); |
} |
} |
va = (V *)ALLOCA(i*sizeof(V)); |
if ( !overwrite ) { |
for ( j = 0, svl = vl; j < i; j++, svl = NEXT(svl) ) |
va = (V *)ALLOCA(i*sizeof(V)); |
va[j] = VR(svl); |
for ( j = 0, svl = vl; j < i; j++, svl = NEXT(svl) ) |
for ( svl = CO; svl; svl = NEXT(svl) ) { |
va[j] = VR(svl); |
v = VR(svl); |
for ( svl = CO; svl; svl = NEXT(svl) ) { |
for ( j = 0; j < i; j++ ) |
v = VR(svl); |
if ( v == va[j] ) |
for ( j = 0; j < i; j++ ) |
break; |
if ( v == va[j] ) |
if ( j == i ) { |
break; |
if ( !vl ) { |
if ( j == i ) { |
NEWVL(vl); tvl = vl; |
if ( !vl ) { |
} else { |
NEWVL(vl); tvl = vl; |
NEWVL(NEXT(tvl)); tvl = NEXT(tvl); |
} else { |
|
NEWVL(NEXT(tvl)); tvl = NEXT(tvl); |
|
} |
|
VR(tvl) = v; |
} |
} |
VR(tvl) = v; |
} |
|
} else { |
|
for ( svl = vl; svl; svl = NEXT(svl) ) { |
|
if ( svl->v->attr == (pointer)V_PF ) |
|
((PFINS)svl->v->priv)->pf->ins = 0; |
} |
} |
} |
} |
if ( vl ) |
if ( vl ) |