=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Doc/httpd-rpc.sm1,v retrieving revision 1.4 retrieving revision 1.10 diff -u -p -r1.4 -r1.10 --- OpenXM/src/kan96xx/Doc/httpd-rpc.sm1 2002/10/24 05:42:00 1.4 +++ OpenXM/src/kan96xx/Doc/httpd-rpc.sm1 2002/11/03 12:43:03 1.10 @@ -1,23 +1,42 @@ -%% $OpenXM: OpenXM/src/kan96xx/Doc/httpd-rpc.sm1,v 1.3 2002/10/24 02:48:59 takayama Exp $ +%% $OpenXM: OpenXM/src/kan96xx/Doc/httpd-rpc.sm1,v 1.9 2002/10/29 10:54:17 takayama Exp $ %% http server by sm1. Used for RPC. Generic example. [(parse) (httpd.sm1) pushfile] extension pop +%% keyword for rpc /httpd.textarea.name (rpc) def /httpd.textarea.name.aaa [(GET /?) httpd.textarea.name] cat (array) dc def -/httpd.port 8090 def + +[(getenv) (OXWEB_PORT)] extension tag 0 eq { + (Default httpd port : ) messagen + /httpd.port 8090 def +} { + /httpd.port [(getenv) (OXWEB_PORT)] extension .. (integer) dc def +} ifelse +(httpd.port = ) messagen httpd.port message + /httpd.serial 0 def +/httpd.oxasir.timer 1 def %% 1 to use timer, but it accepts only one command + %% 0 not to use timer. It accepts programs. + %%******* Put initialization codes for ox_asir here. /httpd.initialization - [ + [(if(1){) (XM_debug=0; ctrl("debug_window",0); Xm_noX=1;) ("Asirweb version 0.80. "+ " Risa/Asir oxasir version "+rtostr(version());) + (};) ] cat def +/httpd.asirman + ("http://www.math.sci.kobe-u.ac.jp/OpenXM/1.2.1/doc/asir2000/html-eg/man_toc.html") +def +/httpd.asirman.ja + ("http://www.math.sci.kobe-u.ac.jp/OpenXM/1.2.1/doc/asir2000/html-jp/man_toc.html") +def [(parse) (oxasir.sm1) pushfile] extension oxNoX @@ -200,10 +219,7 @@ oxNoX (Content-Type: text/html) sendln 0 sendln - (

Usage


) sendln - [(Ask by GET /?) httpd.textarea.name (=) ( encoded_codes HTTP/1.0)] cat - sendln - (
) sendln + (

OpenXM/Risa/Asir Online


) sendln [(getenv) (OXWEB_POST)] extension tag 0 eq { (
) sendln % use get }{ @@ -211,12 +227,30 @@ oxNoX } ifelse () sendln [()] cat sendln + ( rows=7 cols="80" wrap="soft">)] cat sendln (
) sendln - [$ Shutdown the server. , $ - ] cat sendln + (Input example---factorization: fctr(x^3-1)) sendln + (
) sendln + [( + AsirManual (En) , )] cat sendln + [( + AsirManual (Ja) )] cat sendln + httpd.oxasir.timer { + (
It accepts only one command. The limit of CPU time is 30 seconds. + Do not put ; + (semi-colon) after the command. + ) sendln + }{ } ifelse + (
) sendln + [(You can also retrieve the result by GET /?) httpd.textarea.name (=) ( encoded_codes HTTP/1.0)] cat + sendln + (
) sendln + [$ Shutdown the oxserver (and restart it). $ + ] cat sendln + (

Powered by OpenXM and httpd on Kan/sm1

_) sendln 0 sendln [(flush)] extension ] pop @@ -287,7 +321,7 @@ oxNoX } def %% ******* sample of cooked command -/cookedCommand { +/cookedCommand.simplest { /arg1 set [/in-cookedCommand /httpd.com] pushVariables [ @@ -298,8 +332,37 @@ oxNoX popVariables arg1 } def +/cookedCommand { + /arg1 set + [/in-cookedCommand /httpd.com /fff] pushVariables + [ + /httpd.com arg1 def + httpd.oxasir.timer not { + [(if (1) {) httpd.com (; };)] cat + /fff set + }{ +%% It does not work. +%% [$timer(30,eval_str("$ +%% (if (1) {) httpd.com (; };) +%% $"),"Computation is aborted with the resource limit ( 30 seconds)");$ +%% ] cat + [$timer(30,$ httpd.com + $,"Computation is aborted with the resource limit ( 30 seconds) or there was a syntax error.");$ + ] cat + /fff set + } ifelse + (cooked command is ) messagen fff message + /arg1 fff def + ] pop + popVariables + arg1 +} def /httpd.refusedCommands - [(shell) (eval_str) (ox_) (sm1_) (m_) - (connect) (load) + [(shell) (eval_str) (ox_) (sm1_) + (m_start) (m_N_) (m_Inverse) (m_TexForm) %(m_) + (connect) (load) (bload) (bsave) + (end) (quit) (output) (bload27) (open) + (plot) (ctrl) (debug) (error) (port) (bind) (accept) + (draw) (peek) (poke) ] def