[svn] GnuPG - r4557 - in trunk: . agent common doc g10 jnlib scd sm tools

svn author wk cvs at cvs.gnupg.org
Thu Aug 2 20:13:16 CEST 2007


Author: wk
Date: 2007-08-02 20:12:43 +0200 (Thu, 02 Aug 2007)
New Revision: 4557

Added:
   trunk/common/gc-opt-flags.h
Modified:
   trunk/THANKS
   trunk/TODO
   trunk/agent/ChangeLog
   trunk/agent/gpg-agent.c
   trunk/common/ChangeLog
   trunk/common/Makefile.am
   trunk/doc/ChangeLog
   trunk/doc/scdaemon.texi
   trunk/g10/ChangeLog
   trunk/g10/gpg.c
   trunk/jnlib/ChangeLog
   trunk/jnlib/stringhelp.c
   trunk/jnlib/t-stringhelp.c
   trunk/scd/ChangeLog
   trunk/scd/scdaemon.c
   trunk/sm/ChangeLog
   trunk/sm/gpgsm.c
   trunk/tools/ChangeLog
   trunk/tools/gpgconf-comp.c
Log:
Factored common gpgconf constants out
Fixed W32 compare_filenames


Modified: trunk/THANKS
===================================================================
--- trunk/THANKS	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/THANKS	2007-08-02 18:12:43 UTC (rev 4557)
@@ -214,6 +214,7 @@
 Sebastian Klemke           packet at convergence.de
 Serge Munhoven		   munhoven at mema.ucl.ac.be
 SL Baur 		   steve at xemacs.org
+Sten Lindgren              ged at solace dot miun dot se
 Stefan Bellon              sbellon at sbellon.de
 Dr.Stefan.Dalibor          Dr.Stefan.Dalibor at bfa.de
 Stefan Karrmann 	   S.Karrmann at gmx.net

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/TODO	2007-08-02 18:12:43 UTC (rev 4557)
@@ -125,3 +125,10 @@
 ** Migrate OpenPGP keys to another system
 
 
+* do_add_recipient 
+ Prints wrong error message even when decrypting.
+ *Decrypt* does even not work in this case.
+
+* Duplicate certifciates
+  This may happen and lead to an Ambiguous Name error.  Solution is to
+  check the certs for identity beforethorwin this error.

Modified: trunk/agent/ChangeLog
===================================================================
--- trunk/agent/ChangeLog	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/agent/ChangeLog	2007-08-02 18:12:43 UTC (rev 4557)
@@ -1,3 +1,8 @@
+2007-08-02  Werner Koch  <wk at g10code.com>
+
+	* gpg-agent.c: Include gc-opt-flags.h and remove their definition
+	here.
+
 2007-07-13  Werner Koch  <wk at g10code.com>
 
 	* genkey.c (check_passphrase_constraints): Require a confirmation

Modified: trunk/agent/gpg-agent.c
===================================================================
--- trunk/agent/gpg-agent.c	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/agent/gpg-agent.c	2007-08-02 18:12:43 UTC (rev 4557)
@@ -48,6 +48,7 @@
 # include "../jnlib/w32-afunix.h"
 #endif
 #include "setenv.h"
+#include "gc-opt-flags.h"
 
 
 enum cmd_and_opt_values 
@@ -698,24 +699,6 @@
       char *filename_esc;
 
       /* List options and default values in the GPG Conf format.  */
-
-      /* The following list is taken from gnupg/tools/gpgconf-comp.c.  */
-      /* Option flags.  YOU MUST NOT CHANGE THE NUMBERS OF THE EXISTING
-         FLAGS, AS THEY ARE PART OF THE EXTERNAL INTERFACE.  */
-#define GC_OPT_FLAG_NONE	0UL
-      /* The RUNTIME flag for an option indicates that the option can be
-         changed at runtime.  */
-#define GC_OPT_FLAG_RUNTIME	(1UL << 3)
-      /* The DEFAULT flag for an option indicates that the option has a
-         default value.  */
-#define GC_OPT_FLAG_DEFAULT	(1UL << 4)
-      /* The DEF_DESC flag for an option indicates that the option has a
-         default, which is described by the value of the default field.  */
-#define GC_OPT_FLAG_DEF_DESC	(1UL << 5)
-      /* The NO_ARG_DESC flag for an option indicates that the argument has
-         a default, which is described by the value of the ARGDEF field.  */
-#define GC_OPT_FLAG_NO_ARG_DESC	(1UL << 6)
-
       filename = make_filename (opt.homedir, "gpg-agent.conf", NULL );
       filename_esc = percent_escape (filename, NULL);
 

Modified: trunk/common/ChangeLog
===================================================================
--- trunk/common/ChangeLog	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/common/ChangeLog	2007-08-02 18:12:43 UTC (rev 4557)
@@ -1,3 +1,7 @@
+2007-08-02  Werner Koch  <wk at g10code.com>
+
+	* gc-opt-flags.h: New.
+
 2007-08-01  Werner Koch  <wk at g10code.com>
 
 	* estream-printf.c (read_dummy_value): Removed as it is useless now.

Modified: trunk/common/Makefile.am
===================================================================
--- trunk/common/Makefile.am	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/common/Makefile.am	2007-08-02 18:12:43 UTC (rev 4557)
@@ -33,6 +33,7 @@
 	util.h i18n.c i18n.h \
 	errors.h \
 	openpgpdefs.h \
+	gc-opt-flags.h \
 	keyserver.h \
 	sexp-parse.h \
 	init.c init.h \

Added: trunk/common/gc-opt-flags.h
===================================================================
--- trunk/common/gc-opt-flags.h	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/common/gc-opt-flags.h	2007-08-02 18:12:43 UTC (rev 4557)
@@ -0,0 +1,40 @@
+/* gc-opt-flags.h - gpgconf constants used by the backends.
+ * Copyright (C) 2004, 2007  Free Software Foundation, Inc.
+ *
+ * This file is free software; as a special exception the author gives
+ * unlimited permission to copy and/or distribute it, with or without
+ * modifications, as long as this notice is preserved.
+ * 
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY, to the extent permitted by law; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+#ifndef GNUPG_GC_OPT_FLAGS_H
+#define GNUPG_GC_OPT_FLAGS_H
+
+/* Public option flags.  YOU MUST NOT CHANGE THE NUMBERS OF THE
+   EXISTING FLAGS, AS THEY ARE PART OF THE EXTERNAL INTERFACE.  See
+   gnupg/tools/gpgconf-comp.c for details.  */
+
+#define GC_OPT_FLAG_NONE	0UL
+
+/* The RUNTIME flag for an option indicates that the option can be
+   changed at runtime.  */
+#define GC_OPT_FLAG_RUNTIME	(1UL << 3)
+
+/* The DEFAULT flag for an option indicates that the option has a
+   default value.  */
+#define GC_OPT_FLAG_DEFAULT	(1UL << 4)
+
+/* The DEF_DESC flag for an option indicates that the option has a
+   default, which is described by the value of the default field.  */
+#define GC_OPT_FLAG_DEF_DESC	(1UL << 5)
+
+/* The NO_ARG_DESC flag for an option indicates that the argument has
+   a default, which is described by the value of the ARGDEF field.  */
+#define GC_OPT_FLAG_NO_ARG_DESC	(1UL << 6)
+
+
+#endif /*GNUPG_GC_OPT_FLAGS_H*/

Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/doc/ChangeLog	2007-08-02 18:12:43 UTC (rev 4557)
@@ -1,3 +1,7 @@
+2007-07-23  Werner Koch  <wk at g10code.com>
+
+	* scdaemon.texi (Scdaemon Commands): Remove obsolete --print-atr.
+
 2007-07-17  Werner Koch  <wk at g10code.com>
 
 	* gpgsm.texi (Input and Output): Document --default-key.

Modified: trunk/doc/scdaemon.texi
===================================================================
--- trunk/doc/scdaemon.texi	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/doc/scdaemon.texi	2007-08-02 18:12:43 UTC (rev 4557)
@@ -93,11 +93,6 @@
 Run the program in the background.  This option is required to prevent
 it from being accidently running in the background.
 
- at item --print-atr
- at opindex print-atr
-This is mainly a debugging command, used to print the ATR
-(Answer-To-Reset) of a card and exit immediately. 
-
 @end table
 
 

Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/g10/ChangeLog	2007-08-02 18:12:43 UTC (rev 4557)
@@ -1,3 +1,7 @@
+2007-08-02  Werner Koch  <wk at g10code.com>
+
+	* gpg.c: Include gc-opt-flags.h and remove their definition here.
+
 2007-07-17  Werner Koch  <wk at g10code.com>
 
 	* gpg.c (gpgconf_list): Declare --encrypt-to and --default-key.

Modified: trunk/g10/gpg.c
===================================================================
--- trunk/g10/gpg.c	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/g10/gpg.c	2007-08-02 18:12:43 UTC (rev 4557)
@@ -55,8 +55,8 @@
 #include "status.h"
 #include "keyserver-internal.h"
 #include "exec.h"
+#include "gc-opt-flags.h"
 
-
 #if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__)
 #define MY_O_BINARY  O_BINARY
 #ifndef S_IRGRP
@@ -1457,10 +1457,6 @@
 {
   char *configfile_esc = percent_escape (configfile, NULL);
 
-  /* The following definitions are taken from gnupg/tools/gpgconf-comp.c.  */
-#define GC_OPT_FLAG_NONE	0UL
-#define GC_OPT_FLAG_DEFAULT	(1UL << 4)
-
   printf ("gpgconf-gpg.conf:%lu:\"%s\n",
           GC_OPT_FLAG_DEFAULT, configfile_esc ? configfile_esc : "/dev/null");
   printf ("verbose:%lu:\n", GC_OPT_FLAG_NONE);

Modified: trunk/jnlib/ChangeLog
===================================================================
--- trunk/jnlib/ChangeLog	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/jnlib/ChangeLog	2007-08-02 18:12:43 UTC (rev 4557)
@@ -1,3 +1,11 @@
+2007-08-02  Werner Koch  <wk at g10code.com>
+
+	* t-stringhelp.c (test_compare_filenames): New.
+
+	* stringhelp.c (compare_filenames) [HAVE_DRIVE_LETTERS]: Fixed
+	comparison to take slash and backslash in account.
+	(make_filename): Avoid mixing / and \.
+
 2007-07-04  Werner Koch  <wk at g10code.com>
 
 	* utf8conv.c (load_libiconv): Remove URL from translatble string.

Modified: trunk/jnlib/stringhelp.c
===================================================================
--- trunk/jnlib/stringhelp.c	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/jnlib/stringhelp.c	2007-08-02 18:12:43 UTC (rev 4557)
@@ -271,10 +271,10 @@
     char *p;
 
     if ( !(p=strrchr(filepath, '/')) )
-      #ifdef HAVE_DRIVE_LETTERS
+#ifdef HAVE_DRIVE_LETTERS
 	if ( !(p=strrchr(filepath, '\\')) )
 	    if ( !(p=strrchr(filepath, ':')) )
-      #endif
+#endif
 	      {
 		return jnlib_xstrdup(".");
 	      }
@@ -296,42 +296,67 @@
 char *
 make_filename( const char *first_part, ... )
 {
-    va_list arg_ptr ;
-    size_t n;
-    const char *s;
-    char *name, *home, *p;
+  va_list arg_ptr ;
+  size_t n;
+  const char *s;
+  char *name, *home, *p;
+  
+  va_start (arg_ptr, first_part);
+  n = strlen (first_part) + 1;
+  while ( (s = va_arg (arg_ptr, const char *)) )
+    n += strlen(s) + 1;
+  va_end(arg_ptr);
+  
+  home = NULL;
+  if ( *first_part == '~' && first_part[1] == '/'
+       && (home = getenv("HOME")) && *home )
+    n += strlen (home);
+  
+  name = jnlib_xmalloc (n);
+  p = (home 
+       ? stpcpy (stpcpy (name,home), first_part + 1)
+       : stpcpy(name, first_part));
 
-    va_start( arg_ptr, first_part ) ;
-    n = strlen(first_part)+1;
-    while( (s=va_arg(arg_ptr, const char *)) )
-	n += strlen(s) + 1;
-    va_end(arg_ptr);
+  va_start (arg_ptr, first_part) ;
+  while ( (s = va_arg(arg_ptr, const char *)) )
+    p = stpcpy (stpcpy (p,"/"), s);
+  va_end(arg_ptr);
 
-    home = NULL;
-    if( *first_part == '~' && first_part[1] == '/'
-			   && (home = getenv("HOME")) && *home )
-	n += strlen(home);
-
-    name = jnlib_xmalloc(n);
-    p = home ? stpcpy(stpcpy(name,home), first_part+1)
-	     : stpcpy(name, first_part);
-    va_start( arg_ptr, first_part ) ;
-    while( (s=va_arg(arg_ptr, const char *)) )
-	p = stpcpy(stpcpy(p,"/"), s);
-    va_end(arg_ptr);
-
-    return name;
+#ifdef HAVE_DRIVE_LETTERS
+  /* We better avoid mixing slashes and backslashes and prefer
+     backslashes.  There is usual no problem with mixing them, however
+     a very few W32 API calls can't grok plain slashes.  Printing
+     filenames with mixed slashes also looks a bit strange. */
+  if (strchr (name, '\\'))
+    {
+      for (p=name; *p; p++)
+        if (*p == '/')
+          *p = '\\';
+    }
+#endif /*HAVE_DRIVE_LETTERS*/
+  return name;
 }
 
 
 int
-compare_filenames( const char *a, const char *b )
+compare_filenames (const char *a, const char *b)
 {
-    /* ? check whether this is an absolute filename and
-     * resolve symlinks?
-     */
+  /* ? check whether this is an absolute filename and resolve
+     symlinks?  */
 #ifdef HAVE_DRIVE_LETTERS
-    return stricmp(a,b);
+  for ( ; *a && *b; a++, b++ ) 
+    {
+      if (*a != *b 
+          && (toupper (*(const unsigned char*)a)
+              != toupper (*(const unsigned char*)b) )
+          && !((*a == '/' && *b == '\\') || (*a == '\\' && *b == '/')))
+        break;
+    }
+  if ((*a == '/' && *b == '\\') || (*a == '\\' && *b == '/'))
+    return 0;
+  else
+    return (toupper (*(const unsigned char*)a) 
+            - toupper (*(const unsigned char*)b));
 #else
     return strcmp(a,b);
 #endif

Modified: trunk/jnlib/t-stringhelp.c
===================================================================
--- trunk/jnlib/t-stringhelp.c	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/jnlib/t-stringhelp.c	2007-08-02 18:12:43 UTC (rev 4557)
@@ -80,12 +80,49 @@
 }
 
 
+static void
+test_compare_filenames (void)
+{
+  struct {
+    const char *a;
+    const char *b;
+    int result;
+  } tests[] = {
+    { "", "", 0 },
+    { "", "a", -1 },
+    { "a", "", 1 },
+    { "a", "a", 0 },
+    { "a", "aa", -1 },
+    { "aa", "a", 1 },
+    { "a",  "b", -1  },
 
+#ifdef HAVE_W32_SYSTEM
+    { "a", "A", 0 },
+    { "A", "a", 0 },
+    { "foo/bar", "foo\\bar", 0 },
+    { "foo\\bar", "foo/bar", 0 },
+    { "foo\\", "foo/", 0 },
+    { "foo/", "foo\\", 0 },
+#endif /*HAVE_W32_SYSTEM*/
+    { NULL, NULL, 0}
+  };
+  int testno, result;
 
+  for (testno=0; tests[testno].a; testno++)
+    {
+      result = compare_filenames (tests[testno].a, tests[testno].b);
+      result = result < 0? -1 : result > 0? 1 : 0;
+      if (result != tests[testno].result)
+        fail (testno);
+    }
+}
+
+
 int
 main (int argc, char **argv)
 {
   test_percent_escape ();
+  test_compare_filenames ();
 
   return 0;
 }

Modified: trunk/scd/ChangeLog
===================================================================
--- trunk/scd/ChangeLog	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/scd/ChangeLog	2007-08-02 18:12:43 UTC (rev 4557)
@@ -1,3 +1,8 @@
+2007-08-02  Werner Koch  <wk at g10code.com>
+
+	* scdaemon.c: Include gc-opt-flags.h and remove their definition
+	here.
+
 2007-08-01  Werner Koch  <wk at g10code.com>
 
 	* apdu.c (send_le): Implement exact length hack.  Suggested by

Modified: trunk/scd/scdaemon.c
===================================================================
--- trunk/scd/scdaemon.c	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/scd/scdaemon.c	2007-08-02 18:12:43 UTC (rev 4557)
@@ -1,5 +1,6 @@
 /* scdaemon.c  -  The GnuPG Smartcard Daemon
- *	Copyright (C) 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2004, 2005, 
+ *               2007 Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
  *
@@ -51,7 +52,9 @@
 #endif
 #include "ccid-driver.h"
 #include "mkdtemp.h"
+#include "gc-opt-flags.h"
 
+
 enum cmd_and_opt_values 
 { aNull = 0,
   oCsh		  = 'c',
@@ -545,22 +548,6 @@
       char *filename = NULL;
       char *filename_esc;
 
-      /* The following list is taken from gnupg/tools/gpgconf-comp.c.  */
-      /* Option flags.  YOU MUST NOT CHANGE THE NUMBERS OF THE EXISTING
-         FLAGS, AS THEY ARE PART OF THE EXTERNAL INTERFACE.  */
-#define GC_OPT_FLAG_NONE	0UL
-      /* The RUNTIME flag for an option indicates that the option can be
-         changed at runtime.  */
-#define GC_OPT_FLAG_RUNTIME	(1UL << 3)
-      /* The DEFAULT flag for an option indicates that the option has a
-         default value.  */
-#define GC_OPT_FLAG_DEFAULT	(1UL << 4)
-      /* The DEF_DESC flag for an option indicates that the option has a
-         default, which is described by the value of the default field.  */
-#define GC_OPT_FLAG_DEF_DESC	(1UL << 5)
-      /* The NO_ARG_DESC flag for an option indicates that the argument has
-         a default, which is described by the value of the ARGDEF field.  */
-#define GC_OPT_FLAG_NO_ARG_DESC	(1UL << 6)
       if (!config_filename)
         filename = make_filename (opt.homedir, "scdaemon.conf", NULL );
       filename_esc = percent_escape (filename, NULL);

Modified: trunk/sm/ChangeLog
===================================================================
--- trunk/sm/ChangeLog	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/sm/ChangeLog	2007-08-02 18:12:43 UTC (rev 4557)
@@ -1,3 +1,7 @@
+2007-08-02  Werner Koch  <wk at g10code.com>
+
+	* gpgsm.c (main): Factored GC_OPT_FLAGS out to gc-opt-flags.h.
+
 2007-07-17  Werner Koch  <wk at g10code.com>
 
 	* gpgsm.c (main): Implement --default-key.

Modified: trunk/sm/gpgsm.c
===================================================================
--- trunk/sm/gpgsm.c	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/sm/gpgsm.c	2007-08-02 18:12:43 UTC (rev 4557)
@@ -36,6 +36,7 @@
 #include "i18n.h"
 #include "keydb.h"
 #include "sysutils.h"
+#include "gc-opt-flags.h"
 
 
 #ifndef O_BINARY
@@ -1292,17 +1293,18 @@
     gpgsm_exit(2);
   
   /* Set the random seed file. */
-  if (use_random_seed) {
-    char *p = make_filename (opt.homedir, "random_seed", NULL);
-    gcry_control (GCRYCTL_SET_RANDOM_SEED_FILE, p);
-    xfree(p);
-  }
-
-
+  if (use_random_seed) 
+    {
+      char *p = make_filename (opt.homedir, "random_seed", NULL);
+      gcry_control (GCRYCTL_SET_RANDOM_SEED_FILE, p);
+      xfree(p);
+    }
+  
   if (!cmd && opt.fingerprint && !with_fpr)
     set_cmd (&cmd, aListKeys);
   
-  if (!nrings && default_keyring)  /* Add default keybox. */
+  /* Add default keybox. */
+  if (!nrings && default_keyring)
     {
       int created;
 
@@ -1353,7 +1355,7 @@
         }
       
       /* Build the recipient list.  We first add the regular ones and then
-         the encrypt-to ones because the underlying function will silenty
+         the encrypt-to ones because the underlying function will silently
          ignore duplicates and we can't allow to keep a duplicate which is
          flagged as encrypt-to as the actually encrypt function would then
          complain about no (regular) recipients. */
@@ -1369,7 +1371,7 @@
     }
 
   if (log_get_errorcount(0))
-    gpgsm_exit(1); /* must stop for invalid recipients */
+    gpgsm_exit(1); /* Must stop for invalid recipients. */
   
   fname = argc? *argv : NULL;
   
@@ -1377,24 +1379,6 @@
     {
     case aGPGConfList: 
       { /* List options and default values in the GPG Conf format.  */
-
-        /* The following list is taken from gnupg/tools/gpgconf-comp.c.  */
-        /* Option flags.  YOU MUST NOT CHANGE THE NUMBERS OF THE EXISTING
-           FLAGS, AS THEY ARE PART OF THE EXTERNAL INTERFACE.  */
-#define GC_OPT_FLAG_NONE	0UL
-        /* The RUNTIME flag for an option indicates that the option can be
-           changed at runtime.  */
-#define GC_OPT_FLAG_RUNTIME	(1UL << 3)
-        /* The DEFAULT flag for an option indicates that the option has a
-           default value.  */
-#define GC_OPT_FLAG_DEFAULT	(1UL << 4)
-        /* The DEF_DESC flag for an option indicates that the option has a
-           default, which is described by the value of the default field.  */
-#define GC_OPT_FLAG_DEF_DESC	(1UL << 5)
-        /* The NO_ARG_DESC flag for an option indicates that the argument has
-           a default, which is described by the value of the ARGDEF field.  */
-#define GC_OPT_FLAG_NO_ARG_DESC	(1UL << 6)
-
 	char *config_filename_esc = percent_escape (opt.config_filename, NULL);
 
         printf ("gpgconf-gpgsm.conf:%lu:\"%s\n",

Modified: trunk/tools/ChangeLog
===================================================================
--- trunk/tools/ChangeLog	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/tools/ChangeLog	2007-08-02 18:12:43 UTC (rev 4557)
@@ -1,3 +1,8 @@
+2007-08-02  Werner Koch  <wk at g10code.com>
+
+	* gpgconf-comp.c: Factor the public GC_OPT_FLAG constants out and
+	include gc-opt-flags.h.
+
 2007-07-17  Werner Koch  <wk at g10code.com>
 
 	* gpgconf-comp.c: Add --encrypt-to and --default-key to gpg and

Modified: trunk/tools/gpgconf-comp.c
===================================================================
--- trunk/tools/gpgconf-comp.c	2007-08-02 13:17:27 UTC (rev 4556)
+++ trunk/tools/gpgconf-comp.c	2007-08-02 18:12:43 UTC (rev 4557)
@@ -44,6 +44,7 @@
 #include "util.h"
 #include "i18n.h"
 
+#include "gc-opt-flags.h"
 #include "gpgconf.h"
 
 
@@ -308,9 +309,12 @@
   };
 
 
-/* Option flags.  YOU MUST NOT CHANGE THE NUMBERS OF THE EXISTING
-   FLAGS, AS THEY ARE PART OF THE EXTERNAL INTERFACE.  */
-#define GC_OPT_FLAG_NONE	0UL
+/* Option flags.  The flags which are used by the backends are defined
+   by gc-opt-flags.h, included above.
+
+   YOU MUST NOT CHANGE THE NUMBERS OF THE EXISTING FLAGS, AS THEY ARE
+   PART OF THE EXTERNAL INTERFACE.  */
+
 /* Some entries in the option list are not options, but mark the
    beginning of a new group of options.  These entries have the GROUP
    flag set.  */
@@ -322,26 +326,13 @@
    several times.  A comma separated list of arguments is used as the
    argument value.  */
 #define GC_OPT_FLAG_LIST	(1UL << 2)
-/* The RUNTIME flag for an option indicates that the option can be
-   changed at runtime.  */
-#define GC_OPT_FLAG_RUNTIME	(1UL << 3)
-
-/* The following flags are incorporated from the backend.  */
-/* The DEFAULT flag for an option indicates that the option has a
-   default value.  */
-#define GC_OPT_FLAG_DEFAULT	(1UL << 4)
-/* The DEF_DESC flag for an option indicates that the option has a
-   default, which is described by the value of the default field.  */
-#define GC_OPT_FLAG_DEF_DESC	(1UL << 5)
-/* The NO_ARG_DESC flag for an option indicates that the argument has
-   a default, which is described by the value of the ARGDEF field.  */
-#define GC_OPT_FLAG_NO_ARG_DESC	(1UL << 6)
 /* The NO_CHANGE flag for an option indicates that the user should not
    be allowed to chnage this option using the standard gpgconf method.
-   Frontends using gpgconf should grey out such otions, so that only
+   Frontends using gpgconf should grey out such options, so that only
    the current value is displayed.  */
 #define GC_OPT_FLAG_NO_CHANGE   (1UL <<7)
 
+
 /* A human-readable description for each flag.  */
 static struct
 {




More information about the Gnupg-commits mailing list