=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/builtin/print.c,v retrieving revision 1.9 retrieving revision 1.11 diff -u -p -r1.9 -r1.11 --- OpenXM_contrib2/asir2000/builtin/print.c 2001/09/03 08:52:38 1.9 +++ OpenXM_contrib2/asir2000/builtin/print.c 2001/09/04 03:12:20 1.11 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/builtin/print.c,v 1.8 2001/08/31 09:17:12 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/builtin/print.c,v 1.10 2001/09/04 02:45:32 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -53,12 +53,14 @@ void Pprint(); void Pquotetolist(); void Peval_variables_in_quote(); +void Pset_print_function(); FNODE eval_pvar_in_fnode(); struct ftab print_tab[] = { {"print",Pprint,-2}, {"quotetolist",Pquotetolist,1}, {"eval_variables_in_quote",Peval_variables_in_quote,1}, + {"set_print_function",Pset_print_function,-1}, {0,0,0}, }; @@ -278,6 +280,8 @@ Obj *rp; break; case I_PVAR: + if ( FA1(f) ) + error("fnodetotree : not implemented yet"); MKSTR(head,"variable"); GETPVNAME(FA0(f),opname); MKSTR(op,opname); @@ -297,6 +301,7 @@ FNODE f; FNODE a1,a2,a3; pointer r; NODE n,t,t0; + QUOTE q; if ( !f ) return 0; @@ -355,7 +360,8 @@ FNODE f; case I_PVAR: case I_INDEX: case I_POSTSELF: case I_PRESELF: r = eval(f); - return mkfnode(1,I_FORMULA,r); + objtoquote(r,&q); + return BDY(q); default: error("eval_pvar_in_fnode : not implemented yet"); @@ -392,3 +398,16 @@ FNODE *f; } } +FUNC user_print_function; + +void Pset_print_function(arg,rp) +NODE arg; +pointer *rp; +{ + if ( !arg ) + user_print_function = 0; + else { + gen_searchf(BDY((STRING)ARG0(arg)),&user_print_function); + } + *rp = 0; +}