version 1.1, 2018/09/19 05:45:05 |
version 1.3, 2019/03/06 10:43:25 |
|
|
* 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: OpenXM_contrib2/asir2018/builtin/ctrl.c,v 1.2 2018/09/28 08:20:27 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 202 LIST create_control_values(int withdesc) |
|
Line 202 LIST create_control_values(int withdesc) |
|
n = sizeof(ctrls)/sizeof(struct keyval)-1; |
n = sizeof(ctrls)/sizeof(struct keyval)-1; |
top = 0; |
top = 0; |
for ( i = n-1; i >= 0; i-- ) { |
for ( i = n-1; i >= 0; i-- ) { |
STOQ(*(ctrls[i].val),val); |
STOZ(*(ctrls[i].val),val); |
list = create_control_value(ctrls[i].key,(Obj)val,ctrls[i].desc,withdesc); |
list = create_control_value(ctrls[i].key,(Obj)val,ctrls[i].desc,withdesc); |
MKNODE(top1,list,top); top = top1; |
MKNODE(top1,list,top); top = top1; |
} |
} |
/* adj */ |
/* adj */ |
Risa_GC_get_adj(&nm,&dv); UTOQ(nm,num); UTOQ(dv,den); divq((Q)num,(Q)den,&adj); |
Risa_GC_get_adj(&nm,&dv); UTOZ(nm,num); UTOZ(dv,den); divq((Q)num,(Q)den,&adj); |
descstr = "Determines the parameter for Boehm's GC."; |
descstr = "Determines the parameter for Boehm's GC."; |
list = create_control_value("adj",(Obj)adj,descstr,withdesc); |
list = create_control_value("adj",(Obj)adj,descstr,withdesc); |
MKNODE(top1,list,top); top = top1; |
MKNODE(top1,list,top); top = top1; |
Line 227 LIST create_control_values(int withdesc) |
|
Line 227 LIST create_control_values(int withdesc) |
|
} |
} |
} |
} |
MKLIST(l,node); |
MKLIST(l,node); |
descstr = "List of paths in ASIRLOADPATHt."; |
descstr = "List of paths in ASIRLOADPATH."; |
list = create_control_value("loadpath",(Obj)l,descstr,withdesc); |
list = create_control_value("loadpath",(Obj)l,descstr,withdesc); |
MKNODE(top1,list,top); top = top1; |
MKNODE(top1,list,top); top = top1; |
|
|
/* oxpari_id */ |
/* oxpari_id */ |
if(!ox_pari_stream_initialized) { |
if(!ox_pari_stream_initialized) { |
STOQ(-1,val); |
STOZ(-1,val); |
} else val = ox_pari_stream; |
} else val = ox_pari_stream; |
descstr = "Id of ox_pari."; |
descstr = "Id of ox_pari."; |
list = create_control_value("oxpari_id",(Obj)val,descstr,withdesc); |
list = create_control_value("oxpari_id",(Obj)val,descstr,withdesc); |
Line 284 void Pctrl(NODE arg,Obj *rp) |
|
Line 284 void Pctrl(NODE arg,Obj *rp) |
|
/* special treatment is necessary for "adj" */ |
/* special treatment is necessary for "adj" */ |
if ( argc(arg) == 1 ) { |
if ( argc(arg) == 1 ) { |
Risa_GC_get_adj(&nm,&dv); |
Risa_GC_get_adj(&nm,&dv); |
UTOQ(dv,num); |
UTOZ(dv,num); |
UTOQ(nm,den); |
UTOZ(nm,den); |
divq((Q)num,(Q)den,(Q *)rp); |
divq((Q)num,(Q)den,(Q *)rp); |
} else { |
} else { |
absq((Q)ARG1(arg),&c); |
absq((Q)ARG1(arg),&c); |
Line 293 void Pctrl(NODE arg,Obj *rp) |
|
Line 293 void Pctrl(NODE arg,Obj *rp) |
|
error("ctrl : adj : invalid argument"); |
error("ctrl : adj : invalid argument"); |
nmq(c,&num); |
nmq(c,&num); |
dnq(c,&den); |
dnq(c,&den); |
Risa_GC_set_adj(QTOS(den),QTOS(num)); |
Risa_GC_set_adj(ZTOS(den),ZTOS(num)); |
*rp = (Obj)c; |
*rp = (Obj)c; |
} |
} |
return; |
return; |
Line 364 void Pctrl(NODE arg,Obj *rp) |
|
Line 364 void Pctrl(NODE arg,Obj *rp) |
|
} else if ( !strcmp(key,"oxpari_id") ) { |
} else if ( !strcmp(key,"oxpari_id") ) { |
if ( argc(arg) == 1 ) { |
if ( argc(arg) == 1 ) { |
if(!ox_pari_stream_initialized) { |
if(!ox_pari_stream_initialized) { |
STOQ(-1,z); |
STOZ(-1,z); |
*rp = (Obj)z; |
*rp = (Obj)z; |
}else { |
}else { |
*rp = (Obj)ox_pari_stream; |
*rp = (Obj)ox_pari_stream; |
Line 376 void Pctrl(NODE arg,Obj *rp) |
|
Line 376 void Pctrl(NODE arg,Obj *rp) |
|
ox_pari_stream = (Z)c; |
ox_pari_stream = (Z)c; |
*rp = (Obj)c; |
*rp = (Obj)c; |
}else { |
}else { |
STOQ(-1,z); |
STOZ(-1,z); |
*rp = (Obj)z; |
*rp = (Obj)z; |
} |
} |
} |
} |
Line 402 void Pctrl(NODE arg,Obj *rp) |
|
Line 402 void Pctrl(NODE arg,Obj *rp) |
|
if ( argc(arg) == 1 ) |
if ( argc(arg) == 1 ) |
t = *ctrls[i].val; |
t = *ctrls[i].val; |
else |
else |
*ctrls[i].val = t = QTOS((Q)ARG1(arg)); |
*ctrls[i].val = t = ZTOS((Q)ARG1(arg)); |
STOQ(t,z); |
STOZ(t,z); |
*rp = (Obj)z; |
*rp = (Obj)z; |
} else { |
} else { |
sprintf(buf,"ctrl : %s : no such key",key); |
sprintf(buf,"ctrl : %s : no such key",key); |