40 #include "EST_system.h"
42 #include "EST_ServiceTable.h"
43 #include "EST_SiodServer.h"
44 #include "EST_Pathname.h"
45 #include "EST_error.h"
46 #include "EST_Token.h"
49 static EST_Regex ipnum(
"[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+");
52 EST_SiodServer::ResultHandler::ResultHandler()
56 EST_SiodServer::ResultHandler::~ResultHandler()
60 void EST_SiodServer::ResultHandler::process(
void)
64 EST_SiodServer::RequestHandler::RequestHandler()
68 EST_SiodServer::RequestHandler::~RequestHandler()
72 EST_String EST_SiodServer::RequestHandler::process(
void)
74 volatile LISP sexp = scheme(args.val(
"sexp"));
75 volatile LISP result = NULL;
79 res.set_val(
"sexp", est_val(NIL));
83 result = leval(sexp, current_env);
87 res.set_val(
"sexp", est_val(result));
97 EST_SiodServer::EST_SiodServer(
EST_String name)
102 EST_SiodServer::EST_SiodServer(
EST_String hostname,
int port, ostream *trace)
117 EST_SiodServer::EST_SiodServer(
EST_String hostname,
int port)
126 bool EST_SiodServer::parse_command(
const EST_String command,
134 LISP sexp = read_from_string((
char *)(
const char *)command);
136 arguments.
set_val(
"sexp", est_val(sexp));
146 if (package ==
"scheme" && operation ==
"eval")
148 LISP sexp = scheme(arguments.
val(
"sexp"));
149 return siod_sprint(sexp);
155 bool EST_SiodServer::parse_result(
const EST_String resultString,
158 LISP sexp = read_from_string((
char *)(
const char *)resultString);
160 res.
set_val(
"sexp", est_val(sexp));
167 LISP sexp = scheme(res.
val(
"sexp"));
168 return siod_sprint(sexp);