summaryrefslogtreecommitdiff
path: root/src/types.h
diff options
context:
space:
mode:
authorMoritz Schulte <mo@g10code.com>2003-06-09 13:47:04 +0000
committerMoritz Schulte <mo@g10code.com>2003-06-09 13:47:04 +0000
commit6b2617d1f7a8869b4f544f9b1df4bfcf5d6db3a4 (patch)
tree6fd33f18f94f2e86be28b78e27f850c2f3114e1f /src/types.h
parent9a06555b17e1bec8f13bf21473b24e6029f380a8 (diff)
downloadlibgcrypt-6b2617d1f7a8869b4f544f9b1df4bfcf5d6db3a4.tar.gz
v2003-06-09 Moritz Schulte <moritz@g10code.com>
* Makefile.am: Support for libgpg-error. 2003-06-08 Moritz Schulte <moritz@g10code.com> * sexp.c (gcry_sexp_create): Expect sane error values from gcry_sexp_canon_len instead of the `historical' values. 2003-06-07 Moritz Schulte <moritz@g10code.com> * ath.c, ath.c, ath-pth.c, ath-pthread.c, benchmark.c, cipher.h, g10lib.h, gcrypt.h, global.c, misc.c, missing-string.c, module.c, mpi.h, secmem.c, secmem.h, sexp.c, stdmem.c, stdmem.h, testapi.c, types.h: Edited all preprocessor instructions to remove whitespace before the '#'. This is not required by C89, but there are some compilers out there that don't like it. Replaced any occurence of the now deprecated type names with the new ones. * gcrypt.h: Re-organized checking for gcc features; New macro: _GCRY_GCC_ATTR_DEPRECATED. Include copy of libgpg-error's gpg-error.h in order to make it easy to build libgcrypt without needing libgpg-error.h. (GCRY_MPI, GcryMPI, GCRY_SEXP, GcrySexp, GCRY_CIPHER_HD, GcryCipherHd, GCRY_MD_HD, GcryMDHd): Declared deprecated. (gcry_mpi_t, gcry_sexp_t, gcry_cipher_hd_t, gcry_md_hd_t): New types. 2003-06-04 Moritz Schulte <moritz@g10code.com> * sexp.c (sexp_sscan): New argument: arg_list, adjusted all callers. (ARG_NEXT): New macro. (sexp_sscan): Use ARG_NEXT for receiving format string arguments. (gcry_sexp_build_array): New function. 2003-06-02 Moritz Schulte <moritz@g10code.com> * gcrypt.h: Added some comments describing the gcry_sexp_* functions. Include <gpg-error.h> instead of <gpg/error.h>. 2003-06-01 Moritz Schulte <moritz@g10code.com> * sexp.c (OLDPARSECODE): Removed macro... (gcry_sexp_canon_len): ... and do not use it. * gcrypt.h (gcry_errno): Removed declaration. * g10lib.h (string_to_pubkey_algo, pubkey_algo_to_string, pubkey_nbits): Removed declarations for non-existing functions. 2003-05-31 Moritz Schulte <moritz@g10code.com> * cipher.h (is_RSA, is_ELGAMAL): Removed macros. * g10lib.h (set_lasterr): Removed macro. (_gcry_set_lasterr): Removed declaration. * gcrypt.h: Changed declarations for: gcry_pk_algo_info, gcry_md_open, gcry_md_copy, gcry_md_algo_info, gcry_md_info, gcry_md_get_algo, gcry_random_add_bytes. (gcry_md_is_secure): Adjust macro for new API. 2003-05-29 Moritz Schulte <moritz@g10code.com> * gcrypt.h: Changed declarations for: gcry_cipher_open, gcry_cipher_info, gcry_cipher_algo_info. (gcry_cipher_get_algo_keylen): Adjuster for new gcry_cipher_algo_info interface. (gcry_cipher_get_algo_blklen): Likewise. * global.c (gcry_errno): Removed function. (gcry_strerror): Do not use gcry_errno. (_gcry_set_lasterr): Removed function. (last_ec): Removed variable. 2003-05-27 Moritz Schulte <moritz@g10code.com> * gcrypt.h (enum gcry_cipher_algos): Make Serpent IDs do not conflict with OpenPGP. Reported by Timo Schulz. * global.c (gcry_control): Fixed name of enum list. 2003-05-25 Moritz Schulte <moritz@g10code.com> * cipher.h (gcry_cipher_spec): Adjust return type of `setkey' for libgpg-error. (gcry_pubkey_spec): Adjust return type of `generate', `check_secret_key', `encrypt', `decrypt', `sign' and `verify' for libgpg-error. * sexp.c (gcry_sexp_canon_len): Adjusted for libgpg-error. (gcry_sexp_create): Likewise. (gcry_sexp_new): Likewise. (sexp_sscan): Likewise. (gcry_sexp_build): Likewise. (gcry_sexp_sscan): Likewise. * module.c (_gcry_module_add): Likewise. * global.c (last_ec): Change type to gpg_error_t. (gcry_control): Adjust for libgpg-error. (gcry_errno): Likewise. (gcry_strerror): Likewise. (_gcry_set_lasterr): Likewise. (gcry_xmalloc): Likewise. (gcry_xrealloc): Likewise. 2003-05-22 Moritz Schulte <moritz@g10code.com> * types.h: Merged code from GnuPG regarding U64_C. * missing-string.c (strsep): Removed function. * g10lib.h: Removed declarations: strsep, strlwr. * secmem.c (secmem_lock): New variable. (SECMEM_LOCK, SECMEM_UNLOCK): New macros. (_gcry_secmem_set_flags): Use SECMEM_LOCK and SECMEM_UNLOCK. (_gcry_secmem_get_flags): Likewise. (_gcry_secmem_init): Likewie. (_gcry_secmem_malloc): Likewise. (_gcry_secmem_free): Likewise. (_gcry_secmem_malloc): Renamed to ... (_gcry_secmem_malloc_internal): ... this. (_gcry_secmem_malloc): New function, use SECMEM_LOCK, SECMEM_UNLOCK, call _gcry_secmem_malloc_internal. (_gcry_secmem_free): Renamed to ... (_gcry_secmem_free_internal): ... this. (_gcry_secmem_free): New function, use SECMEM_LOCK, SECMEM_UNLOCK, call _gcry_secmem_free_internal. (_gcry_secmem_realloc): Use SECMEM_LOCK, SECMEM_UNLOCK, call _gcry_secmem_malloc_internal and _gcry_secmem_free_internal. (_gcry_private_is_secure): Use SECMEM_LOCK, SECMEM_UNLOCK. (_gcry_secmem_dump_stats): Likewise. (_gcry_secmem_malloc_internal): Removed unused variable: compressed. Include "ath.h". 2003-05-21 Moritz Schulte <moritz@g10code.com> * gcrypt.h (GCRY_CIPHER_SERPENT128, GCRY_CIPHER_SERPENT192, GCRY_CIPHER_SERPENT256): New symbols.
Diffstat (limited to 'src/types.h')
-rw-r--r--src/types.h81
1 files changed, 44 insertions, 37 deletions
diff --git a/src/types.h b/src/types.h
index d603a88f..ff052f94 100644
--- a/src/types.h
+++ b/src/types.h
@@ -1,5 +1,5 @@
/* types.h - some common typedefs
- * Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
*
* This file is part of Libgcrypt.
*
@@ -25,16 +25,16 @@
/* The AC_CHECK_SIZEOF() in configure fails for some machines.
* we provide some fallback values here */
#if !SIZEOF_UNSIGNED_SHORT
- #undef SIZEOF_UNSIGNED_SHORT
- #define SIZEOF_UNSIGNED_SHORT 2
+#undef SIZEOF_UNSIGNED_SHORT
+#define SIZEOF_UNSIGNED_SHORT 2
#endif
#if !SIZEOF_UNSIGNED_INT
- #undef SIZEOF_UNSIGNED_INT
- #define SIZEOF_UNSIGNED_INT 4
+#undef SIZEOF_UNSIGNED_INT
+#define SIZEOF_UNSIGNED_INT 4
#endif
#if !SIZEOF_UNSIGNED_LONG
- #undef SIZEOF_UNSIGNED_LONG
- #define SIZEOF_UNSIGNED_LONG 4
+#undef SIZEOF_UNSIGNED_LONG
+#define SIZEOF_UNSIGNED_LONG 4
#endif
@@ -42,45 +42,45 @@
#ifndef HAVE_BYTE_TYPEDEF
- #undef byte /* maybe there is a macro with this name */
+#undef byte /* maybe there is a macro with this name */
typedef unsigned char byte;
- #define HAVE_BYTE_TYPEDEF
+#define HAVE_BYTE_TYPEDEF
#endif
#ifndef HAVE_USHORT_TYPEDEF
- #undef ushort /* maybe there is a macro with this name */
+#undef ushort /* maybe there is a macro with this name */
typedef unsigned short ushort;
- #define HAVE_USHORT_TYPEDEF
+#define HAVE_USHORT_TYPEDEF
#endif
#ifndef HAVE_ULONG_TYPEDEF
- #undef ulong /* maybe there is a macro with this name */
+#undef ulong /* maybe there is a macro with this name */
typedef unsigned long ulong;
- #define HAVE_ULONG_TYPEDEF
+#define HAVE_ULONG_TYPEDEF
#endif
#ifndef HAVE_U16_TYPEDEF
- #undef u16 /* maybe there is a macro with this name */
- #if SIZEOF_UNSIGNED_INT == 2
+#undef u16 /* maybe there is a macro with this name */
+#if SIZEOF_UNSIGNED_INT == 2
typedef unsigned int u16;
- #elif SIZEOF_UNSIGNED_SHORT == 2
+#elif SIZEOF_UNSIGNED_SHORT == 2
typedef unsigned short u16;
- #else
- #error no typedef for u16
- #endif
- #define HAVE_U16_TYPEDEF
+#else
+#error no typedef for u16
+#endif
+#define HAVE_U16_TYPEDEF
#endif
#ifndef HAVE_U32_TYPEDEF
- #undef u32 /* maybe there is a macro with this name */
- #if SIZEOF_UNSIGNED_INT == 4
+#undef u32 /* maybe there is a macro with this name */
+#if SIZEOF_UNSIGNED_INT == 4
typedef unsigned int u32;
- #elif SIZEOF_UNSIGNED_LONG == 4
+#elif SIZEOF_UNSIGNED_LONG == 4
typedef unsigned long u32;
- #else
- #error no typedef for u32
- #endif
- #define HAVE_U32_TYPEDEF
+#else
+#error no typedef for u32
+#endif
+#define HAVE_U32_TYPEDEF
#endif
/****************
@@ -89,17 +89,24 @@
* Solaris and IRIX.
*/
#ifndef HAVE_U64_TYPEDEF
- #undef u64 /* maybe there is a macro with this name */
- #if SIZEOF_UNSIGNED_INT == 8
+#undef u64 /* maybe there is a macro with this name */
+#if SIZEOF_UNSIGNED_INT == 8
typedef unsigned int u64;
- #define HAVE_U64_TYPEDEF
- #elif SIZEOF_UNSIGNED_LONG == 8
+#define U64_C(c) (c ## U)
+#define HAVE_U64_TYPEDEF
+#elif SIZEOF_UNSIGNED_LONG == 8
typedef unsigned long u64;
- #define HAVE_U64_TYPEDEF
- #elif SIZEOF_UNSIGNED_LONG_LONG == 8
+#define U64_C(c) (c ## UL)
+#define HAVE_U64_TYPEDEF
+#elif SIZEOF_UNSIGNED_LONG_LONG == 8
typedef unsigned long long u64;
- #define HAVE_U64_TYPEDEF
- #endif
+#define U64_C(c) (c ## ULL)
+#define HAVE_U64_TYPEDEF
+#elif SIZEOF_UINT64_T == 8
+ typedef uint64_t u64;
+#define U64_C(c) (UINT64_C(c))
+#define HAVE_U64_TYPEDEF
+#endif
#endif
typedef union {
@@ -107,9 +114,9 @@ typedef union {
short b;
char c[1];
long d;
- #ifdef HAVE_U64_TYPEDEF
+#ifdef HAVE_U64_TYPEDEF
u64 e;
- #endif
+#endif
float f;
double g;
} PROPERLY_ALIGNED_TYPE;