[BACK]Return to tigers.rr CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-contrib / packages / src

File: [local] / OpenXM / src / asir-contrib / packages / src / tigers.rr (download)

Revision 1.2, Tue Jul 26 05:52:50 2005 UTC (18 years, 10 months ago) by takayama
Branch: MAIN
CVS Tags: R_1_3_1-2, RELEASE_1_3_1_13b, RELEASE_1_2_3_12, KNOPPIX_2006, HEAD, DEB_REL_1_2_3-9
Changes since 1.1: +6 -2 lines

Fixed the trouble on the initialization of static variables.
See src/asir-doc/exp/exp-ja.texi.

/* $OpenXM: OpenXM/src/asir-contrib/packages/src/tigers.rr,v 1.2 2005/07/26 05:52:50 takayama Exp $ */
/* Old, tigers, see Attic */

module tigers;

static Tigers_proc$
localf init_Tigers_proc $
def init_Tigers_proc() { 
  Tigers_proc = -1$
}
init_Tigers_proc() $

localf get_Tigers_proc $
localf set_Tigers_proc $
localf find_proc $
localf start $
localf start_unix $
localf start_windows $
localf tigers $

#define TIGERSL_FIND_PROC(P)  P = getopt(proc);\
                          if (type(P) == -1) {\
                             P = find_proc();\
                          }

def get_Tigers_proc() {
  return Tigers_proc;
}
def set_Tigers_proc(A) {
  Tigers_proc = A;
}
def find_proc() {
  /*! extern Tigers_proc; */
  if (Tigers_proc == -1) {
     A = ox_get_serverinfo();
     /* Look for ox_sm1_tigers. Not yet written */
     /* Start tigers automatically if there is not ox_tigers */
     Tigers_proc = start();
  }
  return(Tigers_proc);
}
/*  tigers */
def start() {
  extern Xm_unix;
  if (ox_ostype()[0] == "windows" && Xm_unix == 0)
    return start_windows(0);
  else
    return start_unix();
}
def start_unix() {
  extern Xm_noX;
  extern Sm1_lib;
  if (Xm_noX) {
    P = ox_launch_nox(0,Sm1_lib+"/bin/ox_sm1_tigers"); 
  }else{
    P = ox_launch(0,Sm1_lib+"/bin/ox_sm1_tigers"); 
  }
  ox_check_errors(P);
  return(P);
}

def start_windows(S) {
  extern Xm_debug_on_win_1;
  if (!Xm_debug_on_win_1) {
    error("The component phc has not yet been implemented on Windows(native).");
  }
}

def tigers(A) {
  TIGERSL_FIND_PROC(P);
  sm1.sm1(P," [(getpid)] extension (universalNumber) dc ");
  Pid = ox_pop_cmo(P);
  Fname = "tmp.tigers.out."+rtostr(Pid);
  ox_push_cmo(P,Fname);  sm1.sm1(P," /tmp.tigers.out set ");

  sm1.push_int0(P,A);
  sm1.sm1(P," tigers ");
  return(sm1.pop(P));
}

endmodule;

end$