wip
authorLaurent Mazet <mazet@softndesign.org>
Fri, 21 Mar 2025 22:44:13 +0000 (23:44 +0100)
committerLaurent Mazet <mazet@softndesign.org>
Fri, 21 Mar 2025 22:44:13 +0000 (23:44 +0100)
makefile
morep.h
morep_server.c

index 79f6077a33bd29c2143500ca79d3ef54987923d2..5cc842409e98c7fa3c57a22ce4680a50983e6326 100644 (file)
--- a/makefile
+++ b/makefile
@@ -38,8 +38,8 @@ endif
 # Targets
 
 ALLEXE  =
-ALLEXE += more_server
-ALLEXE += more_test
+ALLEXE += morep_server
+ALLEXE += morep_test
 
 SHELL = bash
 
diff --git a/morep.h b/morep.h
index e083486917f70b3d9a8940b21cf4aa6d52cfee5c..6fd38f072637317347e0ed9b8340337241b50220 100644 (file)
--- a/morep.h
+++ b/morep.h
@@ -73,7 +73,7 @@ int MOREP_Create (char *local_address);
    @see MOREP_Send()
    @see MOREP_Receive()
 */
-int MOREP_Connect (char *local_address, char *remote_address);
+int MOREP_Connect (char *url);
 
 /**
    @ingroup MOREP
index d4b3e5815af45f3f854b84cb264590112d4c3225..abef2538c72164517c21bb901f914da4141ddbb7 100644 (file)
 /* linker: morep.o */
 /* winlnk: morep.o */
 
+#include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <errno.h>
-#include <assert.h>
-#include <pthread.h>
 #include <string.h>
-#include <unistd.h>
 
 #include "debug.h"
 
 #include "morep.h"
 
+char *progname = NULL;
+
 int stop = 0;
 
 void sig_handler (int sig)
@@ -47,7 +46,7 @@ int morep_server (char *url) {
 {
     VERBOSE (morep, TRACE, PRINTF ("morep_server\n"));
 
-    int fd = MOREP_connect (url);
+    int fd = MOREP_Connect (url);
 
     VERBOSE (morep, INFO, PRINTF ("server started at '%s'\n", url));
 
@@ -110,14 +109,14 @@ int main (int argc, char **argv)
         case 'v':
             arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
             if (arg == NULL) {
-                VERBOSE (ERROR, fprintf (stderr, "%s: no directory name\n", progname));
+                VERBOSE (ERROR, fprintf (stderr, "%s: verbose level not specified\n", progname));
                 return usage (1);
             }
             CHANGE_VERBOSE_LEVEL (morep, atoi (arg));
             break;
         case 'h':
         default:
-            printf ("usage: %s [-h] [-v int] <url>\n");
+            printf ("usage: %s [-h] [-v int] <url>\n", progname);
             return (c != 'h');
         }
     }