File: [local] / OpenXM_contrib2 / asir2000 / lib / xm (download)
Revision 1.4, Sun Jan 23 00:25:56 2000 UTC (24 years, 8 months ago) by takayama
Branch: MAIN
CVS Tags: RELEASE_20000124 Changes since 1.3: +25 -7
lines
Minor change of an error message to tell server error.
|
/* $OpenXM: OpenXM_contrib2/asir2000/lib/xm,v 1.4 2000/01/23 00:25:56 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 20000123. ox_help(0); ox_help(\"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]);}
load("sm1")$
load("gnuplot")$
load("tigers")$
load("phc")$
end$