[svn] gpgme - r1123 - in trunk: . doc gpgme
svn author marcus
cvs at cvs.gnupg.org
Thu Oct 6 12:44:27 CEST 2005
Author: marcus
Date: 2005-10-06 12:44:26 +0200 (Thu, 06 Oct 2005)
New Revision: 1123
Modified:
trunk/NEWS
trunk/doc/ChangeLog
trunk/doc/gpgme.texi
trunk/gpgme/ChangeLog
trunk/gpgme/data-mem.c
trunk/gpgme/gpgme.def
trunk/gpgme/gpgme.h
trunk/gpgme/libgpgme.vers
Log:
doc/
2005-10-06 Marcus Brinkmann <marcus at g10code.de>
* gpgme.texi (Destroying Data Buffers): Document gpgme_free.
gpgme/
2005-10-06 Marcus Brinkmann <marcus at g10code.de>
* gpgme.h (gpgme_free): New prototype.
* data-mem.c (gpgme_free): New function.
* libgpgme.vers (GPGME_1.1): Add gpgme_free.
* gpgme.def: Add gpgme_free.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2005-10-02 14:55:33 UTC (rev 1122)
+++ trunk/NEWS 2005-10-06 10:44:26 UTC (rev 1123)
@@ -1,4 +1,4 @@
-Noteworthy changes in version 1.x.y (unreleased)
+Noteworthy changes in version 1.1.1 (unreleased)
------------------------------------------------
* Reading signature notations and policy URLs on key signatures is
@@ -6,10 +6,19 @@
gpgme_key_sig_t structure. This has to be enabled with the keylist
mode flag GPGME_KEYLIST_MODE_SIG_NOTATIONS.
- * Interface changes relative to the 1.0.3 release:
+ * A new gpgme_free() function solves the problem of using different
+ allocators in a single program. This function should now be used
+ instead calling free() to release the buffer returned by
+ gpgme_data_release_and_get_mem. It is recommended that you always
+ do this, but it is only necessary on certain platforms, so backwards
+ compatibility is provided. In other words: If free() worked for
+ you before, it will keep working.
+
+ * Interface changes relative to the 1.1.0 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gpgme_key_sig_t EXTENDED: New field notations.
GPGME_KEYLIST_MODE_SIG_NOTATIONS NEW
+gpgme_free NEW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog 2005-10-02 14:55:33 UTC (rev 1122)
+++ trunk/doc/ChangeLog 2005-10-06 10:44:26 UTC (rev 1123)
@@ -1,3 +1,7 @@
+2005-10-06 Marcus Brinkmann <marcus at g10code.de>
+
+ * gpgme.texi (Destroying Data Buffers): Document gpgme_free.
+
2005-10-02 Marcus Brinkmann <marcus at g10code.de>
* gpgme.texi (Key Management): Add the new member notations of
Modified: trunk/doc/gpgme.texi
===================================================================
--- trunk/doc/gpgme.texi 2005-10-02 14:55:33 UTC (rev 1122)
+++ trunk/doc/gpgme.texi 2005-10-06 10:44:26 UTC (rev 1123)
@@ -1711,15 +1711,23 @@
@code{gpgme_data_release}, except that it returns the data buffer and
its length that was provided by the object.
-The user has to release the buffer with @code{free}. In case the user
-provided the data buffer in non-copy mode, a copy will be made for
-this purpose.
+The user has to release the buffer with @code{gpgme_free}. In case
+the user provided the data buffer in non-copy mode, a copy will be
+made for this purpose.
In case an error returns, or there is no suitable data buffer that can
be returned to the user, the function will return @code{NULL}.
@end deftypefun
+ at deftypefun void gpgme_free (@w{void *@var{buffer}})
+The function @code{gpgme_free} releases the memory returned by
+ at code{gpgme_data_release_and_get_mem}. It should be used instead of
+the system libraries @code{free} function in case different allocators
+are used in a single program.
+ at end deftypefun
+
+
@node Manipulating Data Buffers
@section Manipulating Data Buffers
@cindex data buffer, manipulation
Modified: trunk/gpgme/ChangeLog
===================================================================
--- trunk/gpgme/ChangeLog 2005-10-02 14:55:33 UTC (rev 1122)
+++ trunk/gpgme/ChangeLog 2005-10-06 10:44:26 UTC (rev 1123)
@@ -1,3 +1,10 @@
+2005-10-06 Marcus Brinkmann <marcus at g10code.de>
+
+ * gpgme.h (gpgme_free): New prototype.
+ * data-mem.c (gpgme_free): New function.
+ * libgpgme.vers (GPGME_1.1): Add gpgme_free.
+ * gpgme.def: Add gpgme_free.
+
2005-10-02 Marcus Brinkmann <marcus at g10code.de>
* util.h (_gpgme_decode_percent_string): Add new argument BINARY
Modified: trunk/gpgme/data-mem.c
===================================================================
--- trunk/gpgme/data-mem.c 2005-10-02 14:55:33 UTC (rev 1122)
+++ trunk/gpgme/data-mem.c 2005-10-06 10:44:26 UTC (rev 1123)
@@ -161,6 +161,7 @@
};
+/* Create a new data buffer and return it in R_DH. */
gpgme_error_t
gpgme_data_new (gpgme_data_t *dh)
{
@@ -200,6 +201,9 @@
}
+/* Destroy the data buffer DH and return a pointer to its content.
+ The memory has be to released with gpgme_free() by the user. It's
+ size is returned in R_LEN. */
char *
gpgme_data_release_and_get_mem (gpgme_data_t dh, size_t *r_len)
{
@@ -222,3 +226,13 @@
return str;
}
+
+
+/* Release the memory returned by gpgme_data_release_and_get_mem(). */
+void
+gpgme_free (void *buffer)
+{
+ if (buffer)
+ free (buffer);
+}
+
Modified: trunk/gpgme/gpgme.def
===================================================================
--- trunk/gpgme/gpgme.def 2005-10-02 14:55:33 UTC (rev 1122)
+++ trunk/gpgme/gpgme.def 2005-10-06 10:44:26 UTC (rev 1123)
@@ -151,5 +151,6 @@
gpgme_sig_notation_add @118
gpgme_sig_notation_get @119
+ gpgme_free @120
; END
Modified: trunk/gpgme/gpgme.h
===================================================================
--- trunk/gpgme/gpgme.h 2005-10-02 14:55:33 UTC (rev 1122)
+++ trunk/gpgme/gpgme.h 2005-10-06 10:44:26 UTC (rev 1123)
@@ -996,10 +996,13 @@
int copy);
/* Destroy the data buffer DH and return a pointer to its content.
- The memory has be to released with free by the user. It's size is
- returned in R_LEN. */
+ The memory has be to released with gpgme_free() by the user. It's
+ size is returned in R_LEN. */
char *gpgme_data_release_and_get_mem (gpgme_data_t dh, size_t *r_len);
+/* Release the memory returned by gpgme_data_release_and_get_mem(). */
+void gpgme_free (void *buffer);
+
gpgme_error_t gpgme_data_new_from_cbs (gpgme_data_t *dh,
gpgme_data_cbs_t cbs,
void *handle);
Modified: trunk/gpgme/libgpgme.vers
===================================================================
--- trunk/gpgme/libgpgme.vers 2005-10-02 14:55:33 UTC (rev 1122)
+++ trunk/gpgme/libgpgme.vers 2005-10-06 10:44:26 UTC (rev 1123)
@@ -34,6 +34,8 @@
gpgme_sig_notation_clear;
gpgme_sig_notation_add;
gpgme_sig_notation_get;
+
+ gpgme_free;
};
More information about the Gnupg-commits
mailing list