OSSP CVS Repository

ossp - Check-in [1744]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1744
Date: 2002-Jan-31 14:54:21 (local)
2002-Jan-31 13:54:21 (UTC)
User:thl
Branch:
Comment: moved --groupmode option
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/fixme.h      1.6 -> 1.7     6 inserted, 0 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp_config.c      1.23 -> 1.24     22 inserted, 0 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp_main.c      1.17 -> 1.18     0 inserted, 18 deleted

ossp-pkg/lmtp2nntp/fixme.h 1.6 -> 1.7

--- fixme.h      2002/01/31 13:44:05     1.6
+++ fixme.h      2002/01/31 13:54:21     1.7
@@ -107,4 +107,10 @@
 #define ERR_EXECUTION 1
 #define ERR_DELIVERY -2
 
+enum {
+    GROUPMODE_ARG,
+    GROUPMODE_ENVELOPE,
+    GROUPMODE_HEADER
+};
+
 #endif /* __FIXME_H__ */


ossp-pkg/lmtp2nntp/lmtp2nntp_config.c 1.23 -> 1.24

--- lmtp2nntp_config.c   2002/01/31 13:48:27     1.23
+++ lmtp2nntp_config.c   2002/01/31 13:54:21     1.24
@@ -404,6 +404,28 @@
     }
     catch (ex)
         rethrow;
+
+    /* --groupmode SINGLE */
+    try {
+        if (   (val_get(ctx->val, "option.groupmode", &ov) != VAL_OK)
+            || (ov->ndata != 1)
+            || (ov->data.s == NULL)
+              ) throw(0,0,0);
+        log1(ctx, TRACE, "--groupmode = \"%s\"", ov->data.s);
+
+        if      (strcasecmp(ov->data.s, "arg") == 0)
+            ctx->option_groupmode = GROUPMODE_ARG;
+        else if (strcasecmp(ov->data.s, "envelope") == 0)
+            ctx->option_groupmode = GROUPMODE_ENVELOPE;
+        else if (strcasecmp(ov->data.s, "header") == 0)
+            ctx->option_groupmode = GROUPMODE_HEADER;
+        else {
+            log1(ctx, ERROR, "option --groupmode, invalid mode (%s)", ov->data.s);
+            throw(0,0,0);
+        }
+    }
+    catch (ex)
+        rethrow;
 CUS:
     return;
 }


ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.17 -> 1.18

--- lmtp2nntp_main.c     2002/01/31 13:44:05     1.17
+++ lmtp2nntp_main.c     2002/01/31 13:54:21     1.18
@@ -190,12 +190,6 @@
 static void lmtp_gfs_quit(lmtp2nntp_t *);
 
 enum {
-    GROUPMODE_ARG,
-    GROUPMODE_ENVELOPE,
-    GROUPMODE_HEADER
-};
-
-enum {
     OPERATIONMODE_FAKE,
     OPERATIONMODE_POST,
     OPERATIONMODE_FEED
@@ -464,18 +458,6 @@
     /* read in the arguments */
     while ((i = getopt(argc, argv, "C:DKP:Va:b:c:d:g:h:l:m:n:o:r:s:t:u:v")) != -1) {
         switch (i) {
-            case 'g': /*POD [B<-g> I<groupmode>] */
-                if      (strcasecmp(optarg, "arg") == 0)
-                    ctx->option_groupmode = GROUPMODE_ARG;
-                else if (strcasecmp(optarg, "envelope") == 0)
-                    ctx->option_groupmode = GROUPMODE_ENVELOPE;
-                else if (strcasecmp(optarg, "header") == 0)
-                    ctx->option_groupmode = GROUPMODE_HEADER;
-                else {
-                    fprintf(stderr, "%s:Error: Invalid mode \"%s\" to option -g\n", ctx->progname, optarg);
-                    CU(ERR_EXECUTION);
-                }
-                break;
             case 'h': /*POD [B<-h> I<header>:<value>] */
                 cpHeadername = strdup(optarg);
                 if ((cp = strchr(cpHeadername, ':')) == NULL) {

CVSTrac 2.0.1