aboutsummaryrefslogtreecommitdiff
path: root/src/sman
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-11-28 18:27:48 +0000
committerdos-reis <gdr@axiomatics.org>2010-11-28 18:27:48 +0000
commita53a740a2a1cb6cbfa58cc79caedd4e947ff1ca0 (patch)
tree457424993ac0beaa92f79d5304570d9c6f88edfc /src/sman
parentbbb5a69f0f2348adbbb8db960e5e45306b865683 (diff)
downloadopen-axiom-a53a740a2a1cb6cbfa58cc79caedd4e947ff1ca0.tar.gz
* clef/: Add using directive at toplevel.
* etc/: Likewise. * graph/: Likewise. * hyper/: Likewise. * lib/: Likewise. * sman/: Likewise. * Makefile.am (OA_SMAN_TARGETS): New. (OA_GRAPHICS_TARGETS): Likewise.
Diffstat (limited to 'src/sman')
-rw-r--r--src/sman/session.c12
-rw-r--r--src/sman/sman.c31
-rw-r--r--src/sman/spadclient.c2
3 files changed, 25 insertions, 20 deletions
diff --git a/src/sman/session.c b/src/sman/session.c
index 999dc367..2a64dbc2 100644
--- a/src/sman/session.c
+++ b/src/sman/session.c
@@ -50,6 +50,8 @@
#include "bsdsignal.h"
#include "sockio.h"
+using namespace OpenAxiom;
+
static void usr1_handler(int);
static void usr2_handler(int);
static void term_handler(int);
@@ -276,11 +278,11 @@ static void
read_from_spad_io(void)
{
int ret_code;
- ret_code = sread(spad_io, oa_buffer_address(big_bad_buf), BufSize,
+ ret_code = sread(spad_io, byte_address(big_bad_buf), BufSize,
"session: stdout socket");
if (ret_code == -1) return;
if(active_session != (openaxiom_sio *) 0) {
- ret_code = swrite(active_session, oa_buffer_address(big_bad_buf),
+ ret_code = swrite(active_session, byte_address(big_bad_buf),
ret_code, NULL);
}
}
@@ -354,7 +356,7 @@ accept_session_connection(openaxiom_sio *server_sock)
active_session = (openaxiom_sio *)plSock;
get_string_buf(spad_server, big_bad_buf, BufSize);
ret_code = swrite((openaxiom_sio *)plSock,
- oa_buffer_address(big_bad_buf),
+ byte_address(big_bad_buf),
strlen(big_bad_buf)+1,
"session: writing to InterpWindow");
if (ret_code == -1)
@@ -377,14 +379,14 @@ read_from_session(openaxiom_sio *sock)
send_int(spad_server, sock->frame);
}
active_session = sock;
- ret_code = sread(sock, oa_buffer_address(big_bad_buf), BufSize,
+ ret_code = sread(sock, byte_address(big_bad_buf), BufSize,
"session: reading InterpWindow");
if (ret_code == -1) {
active_session = (openaxiom_sio *) 0;
reading_output = 0;
return;
}
- ret_code = swrite(spad_io, oa_buffer_address(big_bad_buf), ret_code,
+ ret_code = swrite(spad_io, byte_address(big_bad_buf), ret_code,
"session: writing SessionIO");
if (ret_code == -1) {
active_session = (openaxiom_sio *)0 ;
diff --git a/src/sman/sman.c b/src/sman/sman.c
index e0ba9deb..b6e6dbb5 100644
--- a/src/sman/sman.c
+++ b/src/sman/sman.c
@@ -57,10 +57,12 @@
#include "cfuns.h"
#include "utils.h"
-static void process_arguments(openaxiom_command*, int, char**);
+using namespace OpenAxiom;
+
+static void process_arguments(Command*, int, char**);
static int in_X(void);
static void set_up_defaults(void);
-static void process_options(openaxiom_command*, int, char**);
+static void process_options(Command*, int, char**);
static void death_handler(int);
static void sman_catch_signals(void);
static void fix_env(int);
@@ -76,8 +78,8 @@ static void start_the_local_spadclient(void);
static void start_the_session_manager(void);
static void start_the_hypertex(void);
static void start_the_graphics(void);
-static void fork_Axiom(openaxiom_command*);
-static void start_the_Axiom(openaxiom_command*);
+static void fork_Axiom(Command*);
+static void start_the_Axiom(Command*);
static void clean_up_sockets(void);
static void clean_hypertex_socket(void);
static void read_from_spad_io(int);
@@ -149,7 +151,7 @@ struct termios childbuf; /* terminal structure for user i/o */
int death_signal = 0;
static void
-process_arguments(openaxiom_command* command, int argc,char ** argv)
+process_arguments(Command* command, int argc,char ** argv)
{
int arg;
int other = 0;
@@ -246,7 +248,7 @@ set_up_defaults(void)
}
static void
-process_options(openaxiom_command* command, int argc, char **argv)
+process_options(Command* command, int argc, char **argv)
{
set_up_defaults();
process_arguments(command, argc, argv);
@@ -472,7 +474,7 @@ start_the_graphics(void)
/* Start the core executable session in a separate process, */
/* using a pseudo-terminal to catch all input and output */
static void
-fork_Axiom(openaxiom_command* cmd)
+fork_Axiom(Command* cmd)
{
SpadProcess *proc;
@@ -528,15 +530,14 @@ fork_Axiom(openaxiom_command* cmd)
/* Tell the Core that it is being invoked in server mode. */
oa_allocate_process_argv(&cmd->core, 2);
- cmd->core.argv[0] =
- (char*) openaxiom_make_path_for(cmd->root_dir, openaxiom_core_driver);
+ cmd->core.argv[0] = (char*) make_path_for(cmd->root_dir, core_driver);
cmd->core.argv[1] = (char*) "--role=server";
- openaxiom_execute_core(cmd, openaxiom_core_driver);
+ execute_core(cmd, core_driver);
}
}
static void
-start_the_Axiom(openaxiom_command* cmd)
+start_the_Axiom(Command* cmd)
{
server_num = make_server_number();
clean_up_old_sockets();
@@ -598,7 +599,7 @@ read_from_spad_io(int ptcNum)
}
}
else
- ret_code = swrite(session_io, oa_buffer_address(big_bad_buf), ret_code,
+ ret_code = swrite(session_io, byte_address(big_bad_buf), ret_code,
"writing to session man");
if (ret_code == -1) {
perror("writing output to session manager");
@@ -611,7 +612,7 @@ static void
read_from_manager(int ptcNum)
{
int ret_code;
- ret_code = sread(session_io, oa_buffer_address(big_bad_buf), BufSize,
+ ret_code = sread(session_io, byte_address(big_bad_buf), BufSize,
"reading session io");
if (ret_code == -1) {
return;
@@ -758,8 +759,8 @@ monitor_children(void)
int
main(int argc, char *argv[])
{
- openaxiom_command command = { };
- command.root_dir = openaxiom_get_systemdir(argc, argv);
+ Command command = { };
+ command.root_dir = get_systemdir(argc, argv);
process_options(&command, argc, argv);
putenv((char*) "LC_ALL=C");
diff --git a/src/sman/spadclient.c b/src/sman/spadclient.c
index 7d61a296..dd1d6722 100644
--- a/src/sman/spadclient.c
+++ b/src/sman/spadclient.c
@@ -48,6 +48,8 @@
#include "sockio.h"
+using namespace OpenAxiom;
+
openaxiom_sio* sock;
static void