[svn] gpgme - r1487 - in trunk: . src

svn author marcus cvs at cvs.gnupg.org
Wed Aug 18 16:14:28 CEST 2010


Author: marcus
Date: 2010-08-18 16:14:27 +0200 (Wed, 18 Aug 2010)
New Revision: 1487

Modified:
   trunk/NEWS
   trunk/src/ChangeLog
   trunk/src/error.c
   trunk/src/gpgme.def
   trunk/src/gpgme.h.in
   trunk/src/libgpgme.vers
Log:
2010-08-18  Marcus Brinkmann  <marcus at g10code.de>

        * gpgme.def: Add gpgme_err_code_from_syserror and gpgme_err_set_errno.
        * libgpgme.vers: Likewise.
        * gpgme.h.in (gpgme_error_from_errno): Fix return type to
        gpgme_error_t.
	(gpgme_err_code_from_syserror, gpgme_err_set_errno): New prototype.
	(gpgme_error_from_syserror): New inline function (why are
        gpgme_err_make_from_errno and gpgme_error_from_errno not inline
        functions?).
        * error.c (gpgme_error_from_errno): Fix return type to gpgme_error_t.
        (gpgme_err_set_errno, gpgme_err_code_from_syserror): New functions.



Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2010-08-04 07:47:05 UTC (rev 1486)
+++ trunk/src/ChangeLog	2010-08-18 14:14:27 UTC (rev 1487)
@@ -1,3 +1,16 @@
+2010-08-18  Marcus Brinkmann  <marcus at g10code.de>
+
+	* gpgme.def: Add gpgme_err_code_from_syserror and gpgme_err_set_errno.
+	* libgpgme.vers: Likewise.
+	* gpgme.h.in (gpgme_error_from_errno): Fix return type to
+	gpgme_error_t.
+	(gpgme_err_code_from_syserror, gpgme_err_set_errno): New prototype.
+	(gpgme_error_from_syserror): New inline function (why are
+	gpgme_err_make_from_errno and gpgme_error_from_errno not inline
+	functions?).
+	* error.c (gpgme_error_from_errno): Fix return type to gpgme_error_t.
+	(gpgme_err_set_errno, gpgme_err_code_from_syserror): New functions.
+
 2010-08-03  Marcus Brinkmann  <marcus at g10code.de>
 
 	* gpgme-tool.c (result_encrypt_to_xml, result_sign_to_xml)

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2010-08-04 07:47:05 UTC (rev 1486)
+++ trunk/NEWS	2010-08-18 14:14:27 UTC (rev 1487)
@@ -7,7 +7,11 @@
 
  * Interface changes relative to the 1.3.0 release:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- GPGME_EXPORT_MODE_MINIMAL  NEW.
+ GPGME_EXPORT_MODE_MINIMAL      NEW
+ gpgme_err_code_from_syserror   NEW
+ gpgme_err_set_errno            NEW
+ gpgme_error_from_errno		CHANGED: Return gpgme_error_t (compatible type).
+ gpgme_error_from_syserror      NEW
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 

Modified: trunk/src/error.c
===================================================================
--- trunk/src/error.c	2010-08-04 07:47:05 UTC (rev 1486)
+++ trunk/src/error.c	2010-08-18 14:14:27 UTC (rev 1487)
@@ -74,6 +74,25 @@
   return gpg_err_code_from_errno (code);
 }
 
+
+/* Retrieve the error code directly from the ERRNO variable.  This
+   returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
+   (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
+gpgme_err_code_t
+gpgme_err_code_from_syserror (void)
+{
+  return gpg_err_code_from_syserror ();
+}
+
+
+/* Set the ERRNO variable.  This function is the preferred way to set
+   ERRNO due to peculiarities on WindowsCE.  */
+void
+gpgme_err_set_errno (int err)
+{
+  gpg_err_set_errno (err);
+}
+
   
 /* Return an error value with the error source SOURCE and the system
    error ERR.  */
@@ -85,7 +104,7 @@
 
 
 /* Return an error value with the system error ERR.  */
-gpgme_err_code_t
+gpgme_error_t
 gpgme_error_from_errno (int err)
 {
   return gpgme_error (gpg_err_code_from_errno (err));

Modified: trunk/src/gpgme.def
===================================================================
--- trunk/src/gpgme.def	2010-08-04 07:47:05 UTC (rev 1486)
+++ trunk/src/gpgme.def	2010-08-18 14:14:27 UTC (rev 1487)
@@ -199,5 +199,8 @@
     gpgme_op_passwd_start                 @152
     gpgme_op_passwd                       @153
 
+    gpgme_err_code_from_syserror          @154
+    gpgme_err_set_errno                   @155
+
 ; END
 

Modified: trunk/src/gpgme.h.in
===================================================================
--- trunk/src/gpgme.h.in	2010-08-04 07:47:05 UTC (rev 1486)
+++ trunk/src/gpgme.h.in	2010-08-18 14:14:27 UTC (rev 1487)
@@ -164,31 +164,42 @@
    beginning of the error string as fits into the buffer.  */
 int gpgme_strerror_r (gpg_error_t err, char *buf, size_t buflen);
 
-
 /* Return a pointer to a string containing a description of the error
    source in the error value ERR.  */
 const char *gpgme_strsource (gpgme_error_t err);
 
-
 /* Retrieve the error code for the system error ERR.  This returns
    GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
    this).  */
 gpgme_err_code_t gpgme_err_code_from_errno (int err);
 
-
 /* Retrieve the system error for the error code CODE.  This returns 0
    if CODE is not a system error code.  */
 int gpgme_err_code_to_errno (gpgme_err_code_t code);
 
-  
+/* Retrieve the error code directly from the ERRNO variable.  This
+   returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
+   (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
+gpgme_err_code_t gpgme_err_code_from_syserror (void);
+
+/* Set the ERRNO variable.  This function is the preferred way to set
+   ERRNO due to peculiarities on WindowsCE.  */
+void gpgme_err_set_errno (int err);
+
 /* Return an error value with the error source SOURCE and the system
-   error ERR.  */
+   error ERR.  FIXME: Should be inline.  */
 gpgme_error_t gpgme_err_make_from_errno (gpgme_err_source_t source, int err);
 
+/* Return an error value with the system error ERR.  FIXME: Should be inline.  */
+gpgme_error_t gpgme_error_from_errno (int err);
 
-/* Return an error value with the system error ERR.  */
-gpgme_err_code_t gpgme_error_from_errno (int err);
 
+static _GPGME_INLINE gpgme_error_t
+gpgme_error_from_syserror (void)
+{
+  return gpgme_error (gpgme_err_code_from_syserror ());
+}
+
 
 /* The possible encoding mode of gpgme_data_t objects.  */
 typedef enum

Modified: trunk/src/libgpgme.vers
===================================================================
--- trunk/src/libgpgme.vers	2010-08-04 07:47:05 UTC (rev 1486)
+++ trunk/src/libgpgme.vers	2010-08-18 14:14:27 UTC (rev 1487)
@@ -204,6 +204,9 @@
     gpgme_trust_item_get_string_attr;
     gpgme_trust_item_release;
 
+    gpgme_err_code_from_syserror;
+    gpgme_err_set_errno;
+
   local:
     *;
 





More information about the Gnupg-commits mailing list