X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fgacela.c;fp=src%2Fgacela.c;h=2f82d72d26e4b60c9170d1085ee31cdf5df9d1c3;hb=09fa5781bfe3e7b8406a4cee4eb24923e14527b0;hp=a75fe73ef14ef7bf3a2f9f19cc7035666215f5c9;hpb=b5c968767be22ea1aeff7806c191a223c204184b;p=gacela.git diff --git a/src/gacela.c b/src/gacela.c index a75fe73..2f82d72 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -204,14 +204,6 @@ load_scheme_files (char *path) 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) { @@ -245,7 +237,7 @@ int 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; @@ -254,7 +246,7 @@ main (int argc, char *argv[]) // 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; @@ -279,18 +271,6 @@ main (int argc, char *argv[]) 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 (); @@ -309,4 +289,16 @@ main (int argc, char *argv[]) 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); + } }