/[mailutils]/mailutils/mailbox/mu_argp.c
ViewVC logotype

Diff of /mailutils/mailbox/mu_argp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by gray, Fri Nov 22 14:48:05 2002 UTC revision 1.15 by gray, Wed Dec 4 13:22:52 2002 UTC
# Line 307  static char *mu_conf_option[] = { Line 307  static char *mu_conf_option[] = {
307    NULL    NULL
308  };  };
309    
310  static void  void
311  show_options()  mu_print_options ()
312  {  {
313    int i;    int i;
314        
# Line 316  show_options() Line 316  show_options()
316      printf ("%s\n", mu_conf_option[i]);      printf ("%s\n", mu_conf_option[i]);
317  }  }
318    
319    const char *
320    mu_check_option (char *name)
321    {
322      int i;
323      
324      for (i = 0; mu_conf_option[i]; i++)
325        {
326          int len;
327          char *q, *p = strchr (mu_conf_option[i], '=');
328          if (p)
329            len = p - mu_conf_option[i];
330          else
331            len = strlen (mu_conf_option[i]);
332    
333          if (strncasecmp (mu_conf_option[i], name, len) == 0)
334            return mu_conf_option[i];
335          else if ((q = strchr (mu_conf_option[i], '_')) != NULL
336                   && strncasecmp (q + 1, name, len - (q - mu_conf_option[i]) - 1) == 0)
337            return mu_conf_option[i];
338        }
339      return NULL;
340    }  
341    
342  static error_t  static error_t
343  mu_common_argp_parser (int key, char *arg, struct argp_state *state)  mu_common_argp_parser (int key, char *arg, struct argp_state *state)
344  {  {
# Line 331  mu_common_argp_parser (int key, char *ar Line 354  mu_common_argp_parser (int key, char *ar
354        exit (0);        exit (0);
355    
356      case ARG_SHOW_OPTIONS:      case ARG_SHOW_OPTIONS:
357        show_options ();        mu_print_options ();
358        exit (0);        exit (0);
359                
360        /* mailbox */        /* mailbox */
# Line 349  mu_common_argp_parser (int key, char *ar Line 372  mu_common_argp_parser (int key, char *ar
372                case 'E':                case 'E':
373                  flags |= MU_LOCKER_EXTERNAL;                  flags |= MU_LOCKER_EXTERNAL;
374                  break;                  break;
375                    
376                case 'R':                case 'R':
377                  flags |= MU_LOCKER_RETRY;                  flags |= MU_LOCKER_RETRY;
378                  break;                  break;
379                    
380                case 'T':                case 'T':
381                  flags |= MU_LOCKER_TIME;                  flags |= MU_LOCKER_TIME;
382                  break;                  break;
383                    
384                case 'P':                case 'P':
385                  flags |= MU_LOCKER_PID;                  flags |= MU_LOCKER_PID;
386                  break;                  break;
387                    
388                default:                default:
389                  argp_error (state, "invalid lock flag '%c'", *arg);                  argp_error (state, "invalid lock flag '%c'", *arg);
390                }                }
# Line 392  mu_common_argp_parser (int key, char *ar Line 419  mu_common_argp_parser (int key, char *ar
419            }            }
420        break;        break;
421    
   
422        /* log */        /* log */
423      case ARG_LOG_FACILITY:      case ARG_LOG_FACILITY:
424        log_facility = parse_log_facility (arg);        log_facility = parse_log_facility (arg);

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26