diff options
author | Simon Josefsson <simon@josefsson.org> | 2009-03-23 14:37:10 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2009-03-23 14:37:10 +0100 |
commit | 3d829b5b46c498ed80238c1e4c316f661b10f639 (patch) | |
tree | 25c47a60c1d6765003ab8621569cd2f5de93308f /lib | |
parent | 746b8a6acf7a02f235e7879f31faeca213f2d384 (diff) | |
download | libtasn1-3d829b5b46c498ed80238c1e4c316f661b10f639.tar.gz libtasn1-3d829b5b46c498ed80238c1e4c316f661b10f639.tar.bz2 libtasn1-3d829b5b46c498ed80238c1e4c316f661b10f639.zip |
Re-add obsolete stuff for compatibility.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/errors.c | 39 | ||||
-rw-r--r-- | lib/libtasn1.h | 35 |
2 files changed, 73 insertions, 1 deletions
diff --git a/lib/errors.c b/lib/errors.c index e893076..1e46c8c 100644 --- a/lib/errors.c +++ b/lib/errors.c @@ -99,3 +99,42 @@ asn1_strerror (asn1_retCode error) return NULL; } + +#ifndef ASN1_DISABLE_DEPRECATED + +/* Compatibility mappings to preserve ABI. */ + +/** + * libtasn1_perror - prints a string to stderr with a description of an error + * @error: is an error returned by a libtasn1 function. + * + * This function is like perror(). The only difference is that it + * accepts an error returned by a libtasn1 function. + * + * Deprecated: Use asn1_perror() instead. + **/ +void +libtasn1_perror (asn1_retCode error) +{ + asn1_perror (error); +} + +/** + * libtasn1_strerror - Returns a string with a description of an error + * @error: is an error returned by a libtasn1 function. + * + * This function is similar to strerror(). The only difference is + * that it accepts an error (number) returned by a libtasn1 function. + * + * Returns: Pointer to static zero-terminated string describing error + * code. + * + * Deprecated: Use asn1_strerror() instead. + **/ +const char * +libtasn1_strerror (asn1_retCode error) +{ + return asn1_strerror (error); +} + +#endif diff --git a/lib/libtasn1.h b/lib/libtasn1.h index ae523e2..f6236d2 100644 --- a/lib/libtasn1.h +++ b/lib/libtasn1.h @@ -125,7 +125,9 @@ extern "C" }; #endif - typedef struct node_asn_struct *ASN1_TYPE; + typedef struct node_asn_struct node_asn; + + typedef node_asn *ASN1_TYPE; #define ASN1_TYPE_EMPTY NULL @@ -262,6 +264,37 @@ extern "C" asn1_retCode asn1_copy_node (ASN1_TYPE dst, const char *dst_name, ASN1_TYPE src, const char *src_name) ASN1_API; + /* Deprecated stuff. */ + +#ifndef ASN1_DISABLE_DEPRECATED + +#define LIBTASN1_VERSION ASN1_VERSION + +#ifndef MAX_NAME_SIZE +# define MAX_NAME_SIZE ASN1_MAX_NAME_SIZE +#endif + +#ifndef MAX_ERROR_DESCRIPTION_SIZE +# define MAX_ERROR_DESCRIPTION_SIZE ASN1_MAX_ERROR_DESCRIPTION_SIZE +#endif + +#ifndef __attribute__ + /* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) +# define __attribute__(Spec) /* empty */ +# endif +#endif + + /* Use asn1_strerror instead. */ + const char *libtasn1_strerror (asn1_retCode error) + __attribute__ ((deprecated)); + + /* Use asn1_perror instead. */ + void libtasn1_perror (asn1_retCode error) + __attribute__ ((deprecated)); + +#endif + #ifdef __cplusplus } #endif |