[BACK]Return to xm CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / lib

File: [local] / OpenXM_contrib2 / asir2000 / lib / xm (download)

Revision 1.9, Sat Jul 15 05:52:11 2000 UTC (23 years, 10 months ago) by takayama
Branch: MAIN
Changes since 1.8: +3 -3 lines

Changed the opening message of the xm package.

/* $OpenXM: OpenXM_contrib2/asir2000/lib/xm,v 1.9 2000/07/15 05:52:11 takayama Exp $ */
/**  xm  **/
Xm_noX = 0$  
/* 1 : using X-window system. 0 : not using X-window system. */
/* TODO: db.restore should be called after sm1 error and interruption.
         cf. var.sm1,  debugMode
*/

print("xm version 20000715. Copyright (C) OpenXM Developing Team. 2000.")$
print("http://www.openxm.org")$
print("ox_help(0); ox_help(\"keyword\"); ox_grep(\"keyword\"); for help message ")$
XM_debug=1$

/*&C-texi
@c DO NOT EDIT THIS FILE   oxxm.texi
*/
/*&jp-texi
@node OpenXM-Contrib $B0lHLH!?t(B,,, Top
@chapter OpenXM-Contrib $B0lHLH!?t(B
*/
/*&eg-texi
@node OpenXM-Contrib General Functions,,, Top
@chapter OpenXM-Contrib General Functions
*/
/*&jp-texi
@section{$BH!?t0lMw(B}
*/ 
/*&eg-texi
@section{Functions}
*/ 


Sm1_lib = getenv("OpenXM_HOME")$
if (Sm1_lib == 0) {
  Sm1_lib = "/usr/local/lib/sm1"$
} else {
  Sm1_lib = Sm1_lib+"/lib/sm1"$
}
ToAsir_Debug = 0$

def ox_help(A) {
  if (type(A) == 0) {
    shell("ls "+getenv("OpenXM_HOME")+"/lib/asir/help/xm.help");
  }else{
    help("xm.help/"+A)$
  }
}


def ox_get_errors(P) {
  ox_push_cmd(P,276);
  return(ox_pop_cmo(P));
}
def ox_check_errors(P) {
  E = ox_get_errors(P);
  if (E == [ ]) return(P);
  else {
    print("Error during the initialization : double check binary ox-files, library files and environmental variables.");
    print(E);
    debug;
  }
  return(P);
}

/*&eg-texi
@menu
* ox_check_errors2::
@end menu
@node ox_check_errors2,,, Top
@subsection{@code{ox_check_errors2}}
@findex ox_check_errors2
@table @t
@item ox_check_errors2(@var{p})
::  get a list of error objects on the statck of the server @var{p}.
@end table

@table @var
@item return
List
@item p
Number
@end table

@itemize @bullet
@item It gets a list of error objects on the server stack.
@item It does not pop the error objects.
@end itemize
*/
/*&jp-texi
@menu
* ox_check_errors2::
@end menu
@node ox_check_errors2,,, Top
@subsection{@code{ox_check_errors2}}
@findex ox_check_errors2
@table @t
@item ox_check_errors2(@var{p})
::  $B<1JLHV9f(B @var{p} $B$N%5!<%P$N%9%?%C%/>e$K$"$k%(%i!<%*%V%8%'%/%H$r%j%9%H$GLa$9(B.
@end table

@table @var
@item return
$B%j%9%H(B
@item p
$B?t(B
@end table

@itemize @bullet
@item   $B<1JLHV9f(B @var{p} $B$N%5!<%P$N%9%?%C%/>e$K$"$k%(%i!<%*%V%8%'%/%H$r%j%9%H$GLa$9(B.
@item $B%(%i!<%*%V%8%'%/%H$N%]%C%W$O$7$J$$(B.
@end itemize
*/
/*&C-texi
@example
[219] P=sm1_start();
0
[220] sm1(P," 0 get ");
0
[221] ox_check_errors2(P);
[error([7,4294967295,executeString: Usage:get])]
Error on the server of the process number = 1
To clean the stack of the ox server,
type in ox_pops(P,N) (P: process number, N: the number of data you need to pop)
out of the debug mode.
If you like to automatically clean data on the server stack,
set XM_debug=0;

@end example
*/
def ox_check_errors2(P) {
  extern XM_debug;
  E = ox_get_errors(P);
  if (E == [ ]) return(P);
  else {
    print(E);
    print("Error on the server of the process number = ",0)$
    print(P);
    if (XM_debug == 0) {
       print("Automatically cleaning the stack (pop 100 data)....",0)$
       ox_pops(P,100)$
       print("done.")$
       print("If you want to do it by hand, set XM_debug = 1.");
    }else{
       print("To clean the stack of the ox server,");
       print("type in ox_pops(P,N) (P: process number, N: the number of data you need to pop) out of the debug mode");
       print("If you like to automatically clean data on the server stack,");
       print("set XM_debug=0;");
       debug;
    }
  }
  return(P);
}

def first(A) {return(A[0]);}


def ox_grep(A) {
  if (getenv("LANG") == "ja_JP.EUC") {
    F = get_rootdir()+"/help-jp/";
  }else{
    F = get_rootdir()+"/help-eg/";
  }
  Pager = getenv("PAGER");
  if (Pager == 0) Pager="more";
  OF = F+"xm.help";

  print("---------- Result of grep  (ox_grep) ---------------------")$
  shell("(cd " + F + " ; " + " grep "+A+" * xm.help/* | "+Pager+" )");

  print("---------- Possible help keyword  for help -------------")$
  shell("ls "+F+" | grep "+A);
  print("---------- Possible help keyword  for ox_help ----------")$
  shell("ls "+OF+" | grep "+A);

  return(0);
}



load("sm1")$
load("gnuplot")$
load("tigers")$
load("phc")$
load("longname")$

end$