OSSP CVS Repository

ossp - Difference in ossp-pkg/petidomo/main.c versions 1.1 and 1.2
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/petidomo/main.c 1.1 -> 1.2

--- main.c       2000/12/13 13:19:24     1.1
+++ main.c       2000/12/13 15:35:14     1.2
@@ -1,11 +1,21 @@
 /*
- *      $Source: /v/ossp/cvs/ossp-pkg/petidomo/main.c,v $
- *      $Revision: 1.1 $
- *      $Date: 2000/12/13 13:19:24 $
- *
- *      Copyright (C) 1996 by CyberSolutions GmbH.
- *      All rights reserved.
- */
+   $Source: /v/ossp/cvs/ossp-pkg/petidomo/main.c,v $
+   $Revision: 1.2 $
+
+   Copyright (C) 2000 by CyberSolutions GmbH, Germany.
+
+   This file is part of OpenPetidomo.
+
+   OpenPetidomo is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   OpenPetidomo is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+*/
 
 #include <stdio.h>
 #include <sys/stat.h>
@@ -13,9 +23,7 @@
 #include <fcntl.h>
 #include <string.h>
 
-#include <argv.h>
-#include <petidomo.h>
-#include "version.h"
+#include "petidomo.h"
 
 #ifndef LOG_PERROR
 #  define LOG_PERROR 0
@@ -23,20 +31,22 @@
 
 MODULE_TABLE                    /* defined in debug.h */
 static char *        listname = NULL;
+#ifdef DEBUG
 static argv_array_t  debug;
+#endif
 
 int
 main(int argc, char * argv[])
-{
+    {
     const struct PD_Config * MasterConfig;
     char *        incoming_mail;
     char *        programname;
     argv_t        args[] = {
 #ifdef DEBUG
-        {'d', "debug", ARGV_CHARP | ARGV_ARRAY , &debug, "debug",
+        {'d', "debug", ARGV_CHAR_P | ARGV_FLAG_ARRAY , &debug, "debug",
          "Set debug level per module."},
 #endif
-        {ARGV_MAYBE, 0L, ARGV_CHARP, &listname, "listname", "Default mailing list."},
+        {ARGV_MAYBE, 0L, ARGV_CHAR_P, &listname, "listname", "Default mailing list."},
         {ARGV_LAST}
     };
     int           fd;
@@ -69,8 +79,8 @@
 
     /* Parse the command line. */
 
-    argv_help_string = "Petidomo Mailing List Server";
-    argv_version_string = VERS;
+    argv_help_string = "OpenPetidomo Mailing List Server";
+    argv_version_string = "OpenPetidomo";
     argv_process(args, argc, argv);
 
     /* Set debug level according to the wishes of the user. */
@@ -125,22 +135,29 @@
     /* Now decide what we actually do with the mail. */
 
     if (strcasecmp("listserv", programname) == 0)
-      listserv_main(incoming_mail, listname);
-    else if (strcasecmp("hermes", programname) == 0) {
+        listserv_main(incoming_mail, listname);
+    else if (strcasecmp("hermes", programname) == 0)
+        {
         if (listname != NULL)
-          hermes_main(incoming_mail, listname);
-        else {
+            hermes_main(incoming_mail, listname);
+        else
+            {
             syslog(LOG_ERR, "Wrong command line syntax. \"hermes\" requires a parameter.");
             exit(1);
+            }
         }
-    }
-    else {
+    else if (strcasecmp("petidomo", programname) == 0)
+        {
+        /* do nothing */
+        }
+    else
+        {
         syslog(LOG_ERR, "I have been called under an unknown name \"%s\".", programname);
         exit(1);
-    }
+        }
 
     /* Exit gracefully. */
 
     RemoveRescueMail();
     return 0;
-}
+    }

CVSTrac 2.0.1