scm_primitive_load_path (scm_from_locale_string ("gacela_loader.scm"));
}
-void
-start_single ()
-{
- char *argv = "guile";
-
- scm_shell (1, &argv);
-}
-
void
start_server (int port)
{
main (int argc, char *argv[])
{
char *arg;
- int mode = 0; // shell: 1, server: 2, client: 3
+ int mode = 0; // playing: 1, server: 2, client: 3
char *host;
int port = 0;
int i;
// Checking arguments
for (i = 1; i < argc; i++) {
- if (strcmp (argv[i], "--shell-mode") == 0)
+ if (strcmp (argv[i], "--playing") == 0)
mode = 1;
else if (strncmp (argv[i], "--server", 8) == 0) {
mode = 2;
scm_init_guile ();
if (mode == 1) {
- scm_with_guile (&init_gacela, NULL);
- load_scheme_files (dirname (argv[0]));
- start_single ();
- }
- else if (mode == 2 && port != 0) {
- scm_with_guile (&init_gacela, NULL);
- load_scheme_files (dirname (argv[0]));
- start_server (port);
- }
- else if (mode == 3 && port != 0)
- start_remote_client (host, port);
- else {
fd1 = scm_pipe ();
fd2 = scm_pipe ();
pid = fork ();
kill (pid, SIGKILL);
}
}
+ else if (mode == 2 && port != 0) {
+ scm_with_guile (&init_gacela, NULL);
+ load_scheme_files (dirname (argv[0]));
+ start_server (port);
+ }
+ else if (mode == 3 && port != 0)
+ start_remote_client (host, port);
+ else {
+ scm_with_guile (&init_gacela, NULL);
+ load_scheme_files (dirname (argv[0]));
+ scm_shell (argc, argv);
+ }
}