2003-12-25  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Key Management): Rename member class in
	gpgme_key_sig_t to sig_class.
	(Creating a Signature): Likewise for gpgme_signature_t.

gpgme/
2003-12-25  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h (_GPGME_D_CLASS): Revert this change.
	(struct _gpgme_key_sig): For C++ compilers, rename class
	member to _obsolete_class.  Add new member sig_class.
	(struct _gpgme_new_signature): Same here.
	* key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
	not CERTSIG->class.
	* keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
	setting KEYSIG->class, too.  Rename variable CLASS to SIG_CLASS.
	* sign.c (parse_sig_created): Set SIG->sig_class.
This commit is contained in:
Marcus Brinkmann 2003-12-25 14:38:40 +00:00
parent a3d1b15db2
commit de739f876b
8 changed files with 57 additions and 16 deletions

11
NEWS
View File

@ -1,6 +1,17 @@
Noteworthy changes in version 0.4.4 (unreleased) Noteworthy changes in version 0.4.4 (unreleased)
------------------------------------------------ ------------------------------------------------
* The member "class" in gpgme_key_sig_t and gpgme_new_signature_t has
been renamed to "sig_class", to avoid clash with C++ compilers. In
the C API, the old name "class" has been preserved for backwards
compatibility, but is deprecated.
* Interface changes relative to the 0.4.3 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gpgme_key_sig_t CHANGED: class deprecated, use new sig_class.
gpgme_new_signature_t CHANGED: class deprecated, use new sig_class.
Noteworthy changes in version 0.4.3 (2003-10-06) Noteworthy changes in version 0.4.3 (2003-10-06)
------------------------------------------------ ------------------------------------------------

View File

@ -1,3 +1,9 @@
2003-12-25 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Key Management): Rename member class in
gpgme_key_sig_t to sig_class.
(Creating a Signature): Likewise for gpgme_signature_t.
2003-12-23 Moritz Schulte <mo@g10code.com> 2003-12-23 Moritz Schulte <mo@g10code.com>
* gpgme.texi (Listing Keys): Minor clarification for * gpgme.texi (Listing Keys): Minor clarification for

View File

@ -2199,7 +2199,7 @@ signature does not expire.
This is the status of the signature and has the same meaning as the This is the status of the signature and has the same meaning as the
member of the same name in a @code{gpgme_signature_t} object. member of the same name in a @code{gpgme_signature_t} object.
@item unsigned int class @item unsigned int sig_class
This specifies the signature class of the key signature. The meaning This specifies the signature class of the key signature. The meaning
is specific to the crypto engine. is specific to the crypto engine.
@ -4038,7 +4038,7 @@ The public key algorithm used to create this signature.
@item gpgme_hash_algo_t @item gpgme_hash_algo_t
The hash algorithm used to create this signature. The hash algorithm used to create this signature.
@item unsigned int class @item unsigned int sig_class
The signature class of this signature. The signature class of this signature.
@item long int timestamp @item long int timestamp

View File

@ -1,3 +1,15 @@
2003-12-25 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (_GPGME_D_CLASS): Revert this change.
(struct _gpgme_key_sig): For C++ compilers, rename class
member to _obsolete_class. Add new member sig_class.
(struct _gpgme_new_signature): Same here.
* key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
not CERTSIG->class.
* keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
setting KEYSIG->class, too. Rename variable CLASS to SIG_CLASS.
* sign.c (parse_sig_created): Set SIG->sig_class.
2003-12-22 Werner Koch <wk@gnupg.org> 2003-12-22 Werner Koch <wk@gnupg.org>
* gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without

View File

@ -44,10 +44,6 @@ extern "C" {
#if 0 /* just to make Emacs auto-indent happy */ #if 0 /* just to make Emacs auto-indent happy */
} }
#endif #endif
/* Keyword renaming for the sake of C doubleplus. */
#define _GPGME_D_CLASS clazz
#else
#define _GPGME_D_CLASS class
#endif /* __cplusplus */ #endif /* __cplusplus */
#include <gpg-error.h> #include <gpg-error.h>
@ -510,8 +506,12 @@ struct _gpgme_key_sig
/* Same as in gpgme_signature_t. */ /* Same as in gpgme_signature_t. */
gpgme_error_t status; gpgme_error_t status;
/* Crypto backend specific signature class. */ #ifdef __cplusplus
unsigned int _GPGME_D_CLASS; unsigned int _obsolete_class _GPGME_DEPRECATED;
#else
/* Must be set to SIG_CLASS below. */
unsigned int class _GPGME_DEPRECATED;
#endif
/* The user ID string. */ /* The user ID string. */
char *uid; char *uid;
@ -524,6 +524,9 @@ struct _gpgme_key_sig
/* The comment part of the user ID. */ /* The comment part of the user ID. */
char *comment; char *comment;
/* Crypto backend specific signature class. */
unsigned int sig_class;
}; };
typedef struct _gpgme_key_sig *gpgme_key_sig_t; typedef struct _gpgme_key_sig *gpgme_key_sig_t;
@ -1090,8 +1093,15 @@ struct _gpgme_new_signature
/* The fingerprint of the signature. */ /* The fingerprint of the signature. */
char *fpr; char *fpr;
#ifdef __cplusplus
unsigned int _obsolete_class_2;
#else
/* Must be set to SIG_CLASS below. */
unsigned int class _GPGME_DEPRECATED;
#endif
/* Crypto backend specific signature class. */ /* Crypto backend specific signature class. */
unsigned int _GPGME_D_CLASS; unsigned int sig_class;
}; };
typedef struct _gpgme_new_signature *gpgme_new_signature_t; typedef struct _gpgme_new_signature *gpgme_new_signature_t;

View File

@ -695,7 +695,7 @@ gpgme_key_sig_get_ulong_attr (gpgme_key_t key, int uid_idx, _gpgme_attr_t what,
return certsig->expired; return certsig->expired;
case GPGME_ATTR_SIG_CLASS: case GPGME_ATTR_SIG_CLASS:
return certsig->class; return certsig->sig_class;
case GPGME_ATTR_SIG_STATUS: case GPGME_ATTR_SIG_STATUS:
return certsig->status; return certsig->status;

View File

@ -650,11 +650,12 @@ keylist_colon_handler (void *priv, char *line)
if (fields >= 11) if (fields >= 11)
if (field[10][0] && field[10][1]) if (field[10][0] && field[10][1])
{ {
int class = _gpgme_hextobyte (field[10]); int sig_class = _gpgme_hextobyte (field[10]);
if (class >= 0) if (sig_class >= 0)
{ {
keysig->class = class; keysig->sig_class = sig_class;
if (class == 0x30) keysig->class = keysig->sig_class;
if (sig_class == 0x30)
keysig->revoked = 1; keysig->revoked = 1;
} }
if (field[10][2] == 'x') if (field[10][2] == 'x')

View File

@ -143,8 +143,9 @@ parse_sig_created (char *args, gpgme_new_signature_t *sigp)
} }
args = tail; args = tail;
sig->class = strtol (args, &tail, 0); sig->sig_class = strtol (args, &tail, 0);
sig->_obsolete_class = sig->class; sig->class = sig->sig_class;
sig->_obsolete_class = sig->sig_class;
if (errno || args == tail || *tail != ' ') if (errno || args == tail || *tail != ' ')
{ {
/* The crypto backend does not behave. */ /* The crypto backend does not behave. */