try to fix the mess of headers:

- including each other
- calling non types _t
- doing forward enum declarations
- trailing , in enum
- some lint annotations
This commit is contained in:
christos 2009-01-24 19:55:33 +00:00
parent eb0c1ab347
commit 1449463f65
7 changed files with 28 additions and 45 deletions

View File

@ -45,6 +45,7 @@
content.content.error.error=err; \
CBP(info,OPS_PARSER_ERROR,&content); \
return ops_false; \
/*NOTREACHED*/ \
} while(/*CONSTCOND*/0)

View File

@ -4,4 +4,4 @@
#define TIME_T_FMT "%lld"
/* for silencing unused parameter warnings */
#define OPS_USED(x) (x)=(x)
#define OPS_USED(x) /*LINTED*/(void)&(x)

View File

@ -25,7 +25,6 @@
#ifndef OPS_ERRORS
#define OPS_ERRORS
#include "openpgpsdk/types.h"
#include <errno.h>
/** error codes */
@ -88,12 +87,9 @@ typedef enum
OPS_E_PROTO_BAD_ONE_PASS_SIG_VRSN =OPS_E_PROTO+7,
OPS_E_PROTO_BAD_PKSK_VRSN =OPS_E_PROTO+8,
OPS_E_PROTO_DECRYPTED_MSG_WRONG_LEN =OPS_E_PROTO+9,
OPS_E_PROTO_BAD_SK_CHECKSUM =OPS_E_PROTO+10,
OPS_E_PROTO_BAD_SK_CHECKSUM =OPS_E_PROTO+10
} ops_errcode_t;
/** ops_errcode_name_map_t */
typedef ops_map_t ops_errcode_name_map_t;
/** one entry in a linked list of errors */
typedef struct ops_error
{

View File

@ -44,7 +44,7 @@ void ops_init_subregion(ops_region_t *subregion,ops_region_t *region);
#if 0
/** Return values for reader functions e.g. ops_packet_reader_t() */
enum ops_reader_ret_t
typedef enum
{
OPS_R_OK =0, /*!< success */
OPS_R_EOF =1, /*!< reached end of file, no data has been returned */
@ -56,8 +56,8 @@ enum ops_reader_ret_t
armoured block) */
OPS_R_PARTIAL_READ =3, /*!< if OPS_RETURN_LENGTH is set and
the buffer was not filled */
OPS_R_ERROR =4, /*!< if there was an error reading */
};
OPS_R_ERROR =4 /*!< if there was an error reading */
} ops_reader_ret_t;
#endif
/** ops_parse_callback_return_t */
@ -134,12 +134,12 @@ void ops_parse_and_validate(ops_parse_info_t *parse_info);
/** Used to specify whether subpackets should be returned raw, parsed or ignored.
*/
enum ops_parse_type_t
typedef enum
{
OPS_PARSE_RAW, /*!< Callback Raw */
OPS_PARSE_PARSED, /*!< Callback Parsed */
OPS_PARSE_IGNORE, /*!< Don't callback */
};
OPS_PARSE_IGNORE /*!< Don't callback */
} ops_parse_type_t;
void ops_parse_options(ops_parse_info_t *pinfo,ops_content_tag_t tag,
ops_parse_type_t type);

View File

@ -31,6 +31,7 @@
#include <time.h>
#include <openssl/bn.h>
#include <openssl/sha.h>
#include "types.h"
#include "errors.h"
@ -126,8 +127,6 @@ typedef enum
*/
#define OPS_PTAG_NF_CONTENT_TAG_SHIFT 0
/* PTag Content Tags */
/***************************/
@ -138,7 +137,7 @@ typedef enum
* \see RFC4880 4.3
* \see RFC4880 5.2.3.1
*/
enum ops_content_tag_t
typedef enum
{
OPS_PTAG_CT_RESERVED = 0, /*!< Reserved - a packet tag must not have this value */
OPS_PTAG_CT_PK_SESSION_KEY = 1, /*!< Public-Key Encrypted Session Key Packet */
@ -235,8 +234,11 @@ enum ops_content_tag_t
/* Errors */
OPS_PARSER_ERROR =0x500, /*!< Internal Use: Parser Error */
OPS_PARSER_ERRCODE =0x500+1, /*! < Internal Use: Parser Error with errcode returned */
};
OPS_PARSER_ERRCODE =0x500+1 /*! < Internal Use: Parser Error with errcode returned */
} ops_content_tag_t;
typedef ops_content_tag_t ops_packet_tag_t;
typedef ops_content_tag_t ops_ss_type_t;
/** Structure to hold one parse error string. */
typedef struct
@ -292,7 +294,7 @@ typedef enum
OPS_PKA_PRIVATE07 =107, /*!< Private/Experimental Algorithm */
OPS_PKA_PRIVATE08 =108, /*!< Private/Experimental Algorithm */
OPS_PKA_PRIVATE09 =109, /*!< Private/Experimental Algorithm */
OPS_PKA_PRIVATE10 =110, /*!< Private/Experimental Algorithm */
OPS_PKA_PRIVATE10 =110 /*!< Private/Experimental Algorithm */
} ops_public_key_algorithm_t;
/** Structure to hold one DSA public key parameters.
@ -345,7 +347,7 @@ typedef enum
{
OPS_V2=2, /*<! Version 2 (essentially the same as v3) */
OPS_V3=3, /*<! Version 3 */
OPS_V4=4, /*<! Version 4 */
OPS_V4=4 /*<! Version 4 */
} ops_version_t;
/** Structure to hold one pgp public key */
@ -390,7 +392,7 @@ typedef enum
{
OPS_S2KU_NONE=0,
OPS_S2KU_ENCRYPTED_AND_HASHED=254,
OPS_S2KU_ENCRYPTED=255,
OPS_S2KU_ENCRYPTED=255
} ops_s2k_usage_t;
/** s2k_specifier_t
@ -419,7 +421,7 @@ typedef enum
OPS_SA_AES_128 =7, /*!< AES with 128-bit key (AES) */
OPS_SA_AES_192 =8, /*!< AES with 192-bit key */
OPS_SA_AES_256 =9, /*!< AES with 256-bit key */
OPS_SA_TWOFISH =10, /*!< Twofish with 256-bit key (TWOFISH) */
OPS_SA_TWOFISH =10 /*!< Twofish with 256-bit key (TWOFISH) */
} ops_symmetric_algorithm_t;
/** Hashing Algorithm Numbers.
@ -439,7 +441,7 @@ typedef enum
OPS_HASH_SHA256 = 8, /*!< SHA256 */
OPS_HASH_SHA384 = 9, /*!< SHA384 */
OPS_HASH_SHA512 =10, /*!< SHA512 */
OPS_HASH_SHA224 = 11, /*!< SHA224 */
OPS_HASH_SHA224 =11 /*!< SHA224 */
} ops_hash_algorithm_t;
// Maximum block size for symmetric crypto
@ -528,7 +530,7 @@ typedef enum
OPS_SIG_TIMESTAMP =0x40, /*<! Timestamp signature */
OPS_SIG_3RD_PARTY =0x50, /*<! Third-Party Confirmation signature */
OPS_SIG_3RD_PARTY =0x50 /*<! Third-Party Confirmation signature */
} ops_sig_type_t;
/** Struct to hold parameters of an RSA signature */
@ -719,7 +721,7 @@ typedef enum
OPS_C_NONE=0,
OPS_C_ZIP=1,
OPS_C_ZLIB=2,
OPS_C_BZIP2=3,
OPS_C_BZIP2=3
} ops_compression_type_t;
/* unlike most structures, this will feed its data as a stream

View File

@ -39,34 +39,21 @@ typedef struct
const char *string;
} ops_map_t;
/** ops_errcode_name_map_t */
typedef ops_map_t ops_errcode_name_map_t;
/** Boolean type */
typedef unsigned ops_boolean_t;
/** ops_content_tag_t */
typedef enum ops_content_tag_t ops_content_tag_t;
typedef struct _ops_crypt_t ops_crypt_t;
/** ops_hash_t */
typedef struct _ops_hash_t ops_hash_t;
/**
keep both ops_content_tag_t and ops_packet_tag_t because we might
want to introduce some bounds checking i.e. is this really a valid value
for a packet tag?
*/
typedef enum ops_content_tag_t ops_packet_tag_t;
/** SS types are a subset of all content types.
*/
typedef enum ops_content_tag_t ops_ss_type_t;
/* typedef enum ops_sig_type_t ops_sig_type_t; */
/** Revocation Reason type */
typedef unsigned char ops_ss_rr_code_t;
/** ops_parse_type_t */
typedef enum ops_parse_type_t ops_parse_type_t;
/** ops_parser_content_t */
typedef struct ops_parser_content_t ops_parser_content_t;
@ -76,16 +63,13 @@ typedef enum
{
OPS_RETURN_LENGTH=1,
} ops_reader_flags_t;
typedef enum ops_reader_ret_t ops_reader_ret_t;
*/
/** Writer flags */
typedef enum
{
OPS_WF_DUMMY,
OPS_WF_DUMMY
} ops_writer_flags_t;
/** ops_writer_ret_t */
typedef enum ops_writer_ret_t ops_writer_ret_t;
/**
* \ingroup Create

View File

@ -59,7 +59,7 @@ typedef struct
enum
{
ATTRIBUTE=1,
ID,
ID
} last_seen;
ops_user_id_t user_id;
ops_user_attribute_t user_attribute;