rnd-19981010-1
[rocksndiamonds.git] / src / misc.c
index fdbc27259763f84121e4d5894c74919e35eb7752..1ca457c90d8c68abafdced7011cc1cba291efd23 100644 (file)
@@ -233,6 +233,7 @@ void GetOptions(char *argv[])
             "Options:\n"
             "  -d, --display machine:0       X server display\n"
             "  -l, --levels directory        alternative level directory\n"
+            "  -s, --serveronly              only start network server\n"
             "  -n, --network                 network multiplayer game\n"
             "  -v, --verbose                 verbose mode\n",
             program_name);
@@ -266,6 +267,12 @@ void GetOptions(char *argv[])
 
       standalone = FALSE;
     }
+    else if (strncmp(option, "-serveronly", option_len) == 0)
+    {
+      printf("--serveronly\n");
+
+      serveronly = TRUE;
+    }
     else if (strncmp(option, "-verbose", option_len) == 0)
     {
       printf("--verbose\n");
@@ -362,3 +369,16 @@ void Error(int mode, char *format_str, ...)
     CloseAllAndExit(1);
   }
 }
+
+/* like memcpy, but guaranteed to handle overlap when s <= t */
+void copydown(char *s, char *t, int n)
+{
+  for (; n; n--)
+    *(s++) = *(t++);
+}
+
+void fatal(char *s)
+{
+  fprintf(stderr, "%s.\n", s);
+  exit(1);
+}