[BACK]Return to parif.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / builtin

Diff for /OpenXM_contrib2/asir2000/builtin/parif.c between version 1.30 and 1.33

version 1.30, 2015/08/19 05:53:13 version 1.33, 2016/04/01 03:04:35
Line 1 
Line 1 
 /* $OpenXM: OpenXM_contrib2/asir2000/builtin/parif.c,v 1.29 2015/08/19 05:29:23 noro Exp $ */  /* $OpenXM: OpenXM_contrib2/asir2000/builtin/parif.c,v 1.32 2015/08/21 06:00:29 noro Exp $ */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
 #include "ox.h"  #include "ox.h"
Line 6 
Line 6 
 Q ox_pari_stream;  Q ox_pari_stream;
 int ox_pari_stream_initialized = 0;  int ox_pari_stream_initialized = 0;
 int ox_get_pari_result = 0;  int ox_get_pari_result = 0;
   P ox_pari_starting_function = 0;
   
 typedef void (*mpfr_func)(NODE,Obj *);  typedef void (*mpfr_func)(NODE,Obj *);
   
Line 109  pointer evalparif(FUNC f,NODE arg)
Line 110  pointer evalparif(FUNC f,NODE arg)
   USINT ui;    USINT ui;
   Obj ret,dmy;    Obj ret,dmy;
   mpfr_func mpfr_function;    mpfr_func mpfr_function;
     V v;
   
   if ( mpfr_function = mpfr_search(f->name) ) {    if ( arg && ARG0(arg) && NID((Num)ARG0(arg)) != N_C
      (*mpfr_function)(arg,&ret);      && (mpfr_function = mpfr_search(f->name)) ) {
      return (pointer) ret;      (*mpfr_function)(arg,&ret);
       return (pointer) ret;
   }    }
   
   if ( !ox_pari_stream_initialized ) {    if ( !ox_pari_stream_initialized ) {
           if ( ox_pari_starting_function && OID(ox_pari_starting_function) == O_P ) {
                   v = VR(ox_pari_starting_function);
                   if ( (int)v->attr != V_SR ) {
                           error("pari : no handler.");
                   }
                   MKNODE(nd,0,0);
                   r = (Q)bevalf((FUNC)v->priv,0);
           }else {
         MKSTR(name,"ox_pari");          MKSTR(name,"ox_pari");
         nd = mknode(2,NULL,name);          nd = mknode(2,NULL,name);
         Pox_launch_nox(nd,&r);          Pox_launch_nox(nd,&r);
           }
         ox_pari_stream = r;          ox_pari_stream = r;
     ox_pari_stream_initialized = 1;      ox_pari_stream_initialized = 1;
   }    }
Line 141  pointer evalparif(FUNC f,NODE arg)
Line 153  pointer evalparif(FUNC f,NODE arg)
   ox_get_pari_result = 1;    ox_get_pari_result = 1;
   Pox_pop_cmo(oxarg,&ret);    Pox_pop_cmo(oxarg,&ret);
   ox_get_pari_result = 0;    ox_get_pari_result = 0;
     if ( ret && OID(ret) == O_ERR ) {
       char buf[BUFSIZ];
       soutput_init(buf);
       sprintexpr(CO,((ERR)ret)->body);
       error(buf);
     }
   if ( ret && OID(ret) == O_LIST ) {    if ( ret && OID(ret) == O_LIST ) {
     ret = list_to_vect(ret);      ret = list_to_vect(ret);
         ret = vect_to_mat((VECT)ret);          ret = vect_to_mat((VECT)ret);

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.33

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>