aboutsummaryrefslogtreecommitdiff
path: root/src/sman
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-07-29 22:34:06 +0000
committerdos-reis <gdr@axiomatics.org>2010-07-29 22:34:06 +0000
commit78f7e5da35751c2ce43bf45588b2c8998e0d11fe (patch)
treef93303c0d3488401d847fab55f322a9cbaccbcca /src/sman
parent1b7a0340896d0fb7b2d99ba9c1358cac9f7b03d3 (diff)
downloadopen-axiom-78f7e5da35751c2ce43bf45588b2c8998e0d11fe.tar.gz
* clef/Makefile.in: Build and link programs by a C++ compiler.
* clef/edible.c: Make it acceptable to a C++ compiler. * driver/utils.c: Likewise. * sman/sman.c: Likewise.
Diffstat (limited to 'src/sman')
-rw-r--r--src/sman/Makefile.in2
-rw-r--r--src/sman/sman.c38
-rw-r--r--src/sman/sman.h2
3 files changed, 21 insertions, 21 deletions
diff --git a/src/sman/Makefile.in b/src/sman/Makefile.in
index 2d01a620..261f40ac 100644
--- a/src/sman/Makefile.in
+++ b/src/sman/Makefile.in
@@ -81,7 +81,7 @@ stamp: $(OUTLIB)/session$(EXEEXT) \
.PRECIOUS: %.lo %.obj
%.lo: %.c
- $(COMPILE) ${CCF} -o $@ $(axiom_includes) -I$(srcdir) \
+ $(CXXCOMPILE) ${CCF} -o $@ $(axiom_includes) -I$(srcdir) \
-I$(top_srcdir)/src/driver $<
${OUTLIB}/session$(EXEEXT): $(session_objects) $(session_DEPENDENCIES)
diff --git a/src/sman/sman.c b/src/sman/sman.c
index 948a748a..3a7093d0 100644
--- a/src/sman/sman.c
+++ b/src/sman/sman.c
@@ -1,7 +1,7 @@
/*
Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2009, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -65,12 +65,12 @@ static void death_handler(int);
static void sman_catch_signals(void);
static void fix_env(int);
static void init_term_io(void);
-static char* strPrefix(char* , char*);
-static void check_spad_proc(char* , char*);
+static const char* strPrefix(const char* , const char*);
+static void check_spad_proc(const char* , const char*);
static void clean_up_old_sockets(void);
static SpadProcess* fork_you(int);
-static void exec_command_env(char*);
-static SpadProcess* spawn_of_hell(char* , int);
+static void exec_command_env(const char*);
+static SpadProcess* spawn_of_hell(const char* , int);
static void start_the_spadclient(void);
static void start_the_local_spadclient(void);
static void start_the_session_manager(void);
@@ -104,12 +104,12 @@ int server_num; /* OpenAxiom server number */
/* definitions of programs which sman can start */
/************************************************/
-char *GraphicsProgram = "$AXIOM/lib/viewman";
-char *HypertexProgram = "$AXIOM/lib/hypertex -s";
-char *ClefProgram =
+const char *GraphicsProgram = "$AXIOM/lib/viewman";
+const char *HypertexProgram = "$AXIOM/lib/hypertex -s";
+const char *ClefProgram =
"$AXIOM/bin/clef -f $AXIOM/lib/command.list -e ";
-char *SessionManagerProgram = "$AXIOM/lib/session";
-char *SpadClientProgram = "$AXIOM/lib/spadclient";
+const char *SessionManagerProgram = "$AXIOM/lib/session";
+const char *SpadClientProgram = "$AXIOM/lib/spadclient";
char *PasteFile = NULL;
char *MakeRecordFile = NULL;
char *VerifyRecordFile = NULL;
@@ -319,8 +319,8 @@ init_term_io(void)
_EOL = oldbuf.c_cc[VEOL];
}
-static char *
-strPrefix(char *prefix,char * s)
+static const char*
+strPrefix(const char* prefix, const char* s)
{
while (*prefix != '\0' && *prefix == *s) {
prefix++;
@@ -331,9 +331,9 @@ strPrefix(char *prefix,char * s)
}
static void
-check_spad_proc(char *file, char *prefix)
+check_spad_proc(const char *file, const char *prefix)
{
- char *num;
+ const char *num;
int pid;
if ((num = strPrefix(prefix, file))) {
pid = atoi(num);
@@ -392,7 +392,7 @@ fork_you(int death_action)
}
static void
-exec_command_env(char *command)
+exec_command_env(const char *command)
{
char new_command[512];
sprintf(new_command, "exec %s", command);
@@ -400,7 +400,7 @@ exec_command_env(char *command)
}
static SpadProcess *
-spawn_of_hell(char *command, int death_action)
+spawn_of_hell(const char *command, int death_action)
{
SpadProcess *proc = fork_you(death_action);
if (proc != NULL) {
@@ -529,8 +529,8 @@ 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] =
- openaxiom_make_path_for(cmd->root_dir, openaxiom_core_driver);
- cmd->core.argv[1] = "--role=server";
+ (char*) openaxiom_make_path_for(cmd->root_dir, openaxiom_core_driver);
+ cmd->core.argv[1] = (char*) "--role=server";
openaxiom_execute_core(cmd, openaxiom_core_driver);
}
}
@@ -762,7 +762,7 @@ main(int argc, char *argv[])
command.root_dir = openaxiom_get_systemdir(argc, argv);
process_options(&command, argc, argv);
- putenv("LC_ALL=C");
+ putenv((char*) "LC_ALL=C");
setlocale(LC_ALL, "");
bsdSignal(SIGINT, SIG_IGN,RestartSystemCalls);
init_term_io();
diff --git a/src/sman/sman.h b/src/sman/sman.h
index 262b62d9..4303e080 100644
--- a/src/sman/sman.h
+++ b/src/sman/sman.h
@@ -48,7 +48,7 @@
typedef struct spad_proc {
int proc_id; /* process id of child */
int death_action; /* one of the above constants */
- char *command; /* sh command line to restart the process */
+ const char* command; /* sh command line to restart the process */
struct spad_proc *next;
} SpadProcess;