Annotation of OpenXM_contrib2/asir2000/lib/xm, Revision 1.4
1.4 ! takayama 1: /* $OpenXM: OpenXM_contrib2/asir2000/lib/xm,v 1.3 2000/01/16 06:28:00 takayama Exp $ */
1.1 noro 2: /** xm **/
3: Xm_noX = 0$
4: /* 1 : using X-window system. 0 : not using X-window system. */
5: /* TODO: db.restore should be called after sm1 error and interruption.
6: cf. var.sm1, debugMode
7: */
8:
1.4 ! takayama 9: print("xm Version 20000123. ox_help(0); ox_help(\"keyword\"); for help message ")$
! 10: XM_debug=1$
1.1 noro 11:
12: /*&C-texi
13: @c DO NOT EDIT THIS FILE oxxm.texi
14: */
15: /*&jp-texi
16: @node OpenXM-Contrib $B0lHLH!?t(B,,, Top
17: @chapter OpenXM-Contrib $B0lHLH!?t(B
18: */
19: /*&eg-texi
20: @node OpenXM-Contrib General Functions,,, Top
21: @chapter OpenXM-Contrib General Functions
22: */
23: /*&jp-texi
24: @section{$BH!?t0lMw(B}
25: */
26: /*&eg-texi
27: @section{Functions}
28: */
29:
30:
31: Sm1_lib = getenv("OpenXM_HOME")$
32: if (Sm1_lib == 0) {
33: Sm1_lib = "/usr/local/lib/sm1"$
34: } else {
35: Sm1_lib = Sm1_lib+"/lib/sm1"$
36: }
37: ToAsir_Debug = 0$
38:
39: def ox_help(A) {
40: if (type(A) == 0) {
1.2 takayama 41: shell("ls "+getenv("OpenXM_HOME")+"/lib/asir/help/xm.help");
1.1 noro 42: }else{
1.2 takayama 43: help("xm.help/"+A)$
1.1 noro 44: }
45: }
46:
47:
48: def ox_get_errors(P) {
49: ox_push_cmd(P,276);
50: return(ox_pop_cmo(P));
51: }
52: def ox_check_errors(P) {
53: E = ox_get_errors(P);
54: if (E == [ ]) return(P);
55: else {
56: print("Error during the initialization : double check binary ox-files, library files and environmental variables.");
57: print(E);
58: debug;
59: }
60: return(P);
61: }
62:
63: /*&eg-texi
64: @menu
65: * ox_check_errors2::
66: @end menu
67: @node ox_check_errors2,,, Top
68: @subsection{@code{ox_check_errors2}}
69: @findex ox_check_errors2
70: @table @t
71: @item ox_check_errors2(@var{p})
72: :: get a list of error objects on the statck of the server @var{p}.
73: @end table
74:
75: @table @var
76: @item return
77: List
78: @item p
79: Number
80: @end table
81:
82: @itemize @bullet
83: @item It gets a list of error objects on the server stack.
84: @item It does not pop the error objects.
85: @end itemize
86: */
87: /*&jp-texi
88: @menu
89: * ox_check_errors2::
90: @end menu
91: @node ox_check_errors2,,, Top
92: @subsection{@code{ox_check_errors2}}
93: @findex ox_check_errors2
94: @table @t
95: @item ox_check_errors2(@var{p})
96: :: $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.
97: @end table
98:
99: @table @var
100: @item return
101: $B%j%9%H(B
102: @item p
103: $B?t(B
104: @end table
105:
106: @itemize @bullet
107: @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.
108: @item $B%(%i!<%*%V%8%'%/%H$N%]%C%W$O$7$J$$(B.
109: @end itemize
110: */
111: /*&C-texi
112: @example
113: [219] P=sm1_start();
114: 0
115: [220] sm1(P," 0 get ");
116: 0
117: [221] ox_check_errors2(P);
118: [error([7,4294967295,executeString: Usage:get])]
1.4 ! takayama 119: Error on the server of the process number = 1
! 120: To clean the stack of the ox server,
! 121: type in ox_pops(P,N) (P: process number, N: the number of data you need to pop)
! 122: out of the debug mode.
! 123: If you like to automatically clean data on the server stack,
! 124: set XM_debug=0;
! 125:
1.1 noro 126: @end example
127: */
128: def ox_check_errors2(P) {
1.4 ! takayama 129: extern XM_debug;
1.1 noro 130: E = ox_get_errors(P);
131: if (E == [ ]) return(P);
132: else {
133: print(E);
1.4 ! takayama 134: print("Error on the server of the process number = ",0)$
! 135: print(P);
! 136: if (XM_debug == 0) {
! 137: print("Automatically cleaning the stack (pop 100 data)....",0)$
! 138: ox_pops(P,100)$
! 139: print("done.")$
! 140: print("If you want to do it by hand, set XM_debug = 1.");
! 141: }else{
! 142: print("To clean the stack of the ox server,");
! 143: print("type in ox_pops(P,N) (P: process number, N: the number of data you need to pop) out of the debug mode");
! 144: print("If you like to automatically clean data on the server stack,");
! 145: print("set XM_debug=0;");
! 146: debug;
! 147: }
1.1 noro 148: }
149: return(P);
150: }
1.3 takayama 151:
152: def first(A) {return(A[0]);}
1.1 noro 153:
154: load("sm1")$
155: load("gnuplot")$
156: load("tigers")$
157: load("phc")$
158:
159: end$
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>