[svn] gpgme - r1177 - in trunk: doc gpgme

svn author marcus cvs at cvs.gnupg.org
Sun Jul 16 15:36:05 CEST 2006


Author: marcus
Date: 2006-07-16 15:36:04 +0200 (Sun, 16 Jul 2006)
New Revision: 1177

Modified:
   trunk/doc/ChangeLog
   trunk/doc/gpgme.texi
   trunk/gpgme/ChangeLog
   trunk/gpgme/gpgme.c
Log:
doc/
2005-03-24  Marcus Brinkmann  <marcus at g10code.de>

	* gpgme.texi (Library Version Check): Make example code compatible
	to W32 systems.

gpgme/
2005-03-24  Marcus Brinkmann  <marcus at g10code.de>

	* gpgme.c (gpgme_set_locale): Remove conditional on
	HAVE_W32_SYSTEM, and just check for LC_MESSAGES.


Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog	2006-07-16 13:27:08 UTC (rev 1176)
+++ trunk/doc/ChangeLog	2006-07-16 13:36:04 UTC (rev 1177)
@@ -1,3 +1,8 @@
+2005-03-24  Marcus Brinkmann  <marcus at g10code.de>
+
+	* gpgme.texi (Library Version Check): Make example code compatible
+	to W32 systems.
+
 2006-06-21  Marcus Brinkmann  <marcus at g10code.de>
 
 	* gpgme.texi (Passphrase Callback): Fix inverted condition in

Modified: trunk/doc/gpgme.texi
===================================================================
--- trunk/doc/gpgme.texi	2006-07-16 13:27:08 UTC (rev 1176)
+++ trunk/doc/gpgme.texi	2006-07-16 13:36:04 UTC (rev 1177)
@@ -609,13 +609,16 @@
   setlocale (LC_ALL, "");
   gpgme_check_version (NULL);
   gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
+#ifdef LC_MESSAGES
   gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
+#endif
 @}
 @end example
 
 Note that you are highly recommended to initialize the locale settings
 like this.  @acronym{GPGME} can not do this for you because it would
-not be thread safe.
+not be thread safe.  The conditional on LC_MESSAGES is only necessary
+for portability to W32 systems.
 
 
 @node Signal Handling

Modified: trunk/gpgme/ChangeLog
===================================================================
--- trunk/gpgme/ChangeLog	2006-07-16 13:27:08 UTC (rev 1176)
+++ trunk/gpgme/ChangeLog	2006-07-16 13:36:04 UTC (rev 1177)
@@ -1,3 +1,8 @@
+2005-03-24  Marcus Brinkmann  <marcus at g10code.de>
+
+	* gpgme.c (gpgme_set_locale): Remove conditional on
+	HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
+
 2006-07-16  Marcus Brinkmann  <marcus at g10code.de>
 
 	* rungpg.c (read_status): Strip potential carriage return.

Modified: trunk/gpgme/gpgme.c
===================================================================
--- trunk/gpgme/gpgme.c	2006-07-16 13:27:08 UTC (rev 1176)
+++ trunk/gpgme/gpgme.c	2006-07-16 13:36:04 UTC (rev 1177)
@@ -1,6 +1,6 @@
 /* gpgme.c - GnuPG Made Easy.
    Copyright (C) 2000 Werner Koch (dd9jn)
-   Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
+   Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
 
    This file is part of GPGME.
  
@@ -341,10 +341,9 @@
 gpgme_error_t
 gpgme_set_locale (gpgme_ctx_t ctx, int category, const char *value)
 {
-#ifndef HAVE_W32_SYSTEM
   int failed = 0;
-  char *new_lc_ctype;
-  char *new_lc_messages;
+  char *new_lc_ctype = NULL;
+  char *new_lc_messages = NULL;
 
 #define PREPARE_ONE_LOCALE(lcat, ucat)				\
   if (!failed && value						\
@@ -353,12 +352,12 @@
       new_lc_ ## lcat = strdup (value);				\
       if (!new_lc_ ## lcat)					\
         failed = 1;						\
-    }								\
-  else								\
-    new_lc_ ## lcat = NULL;
+    }
 
   PREPARE_ONE_LOCALE (ctype, CTYPE);
+#ifdef LC_MESSAGES
   PREPARE_ONE_LOCALE (messages, MESSAGES);
+#endif
 
   if (failed)
     {
@@ -392,12 +391,12 @@
   if (!ctx)
     LOCK (def_lc_lock);
   SET_ONE_LOCALE (ctype, CTYPE);
+#ifdef LC_MESSAGES
   SET_ONE_LOCALE (messages, MESSAGES);
+#endif
   if (!ctx)
     UNLOCK (def_lc_lock);
 
-#endif /*!HAVE_W32_SYSTEM*/
-  
   return 0;
 }
 




More information about the Gnupg-commits mailing list