c4e_sys.h File Reference

(Version 554)

System-wide used (common) types, defines and macros. More...

#include "c4e_arch.h"
#include <assert.h>
Include dependency graph for c4e_sys.h:

Go to the source code of this file.

Defines

#define C4E_FALSE
#define C4E_TRUE
#define C4E_SYS_UINT8_ZERO
#define C4E_SYS_UINT8_ONE
#define C4E_SYS_DIGIT_ZERO
#define C4E_SYS_DIGIT_ONE
#define C4E_SYS_DIGIT_MAX
#define C4E_SYS_DIGIT_BITS
#define C4E_SYS_DIGIT_MSBIT
#define C4E_SYS_DIGIT_LSBYTE
#define C4E_SYS_DIGIT_MSBYTE
#define C4E_SYS_VECTOR_SIZE(vec)
 Returns the number of elements in a vector (array).
#define C4E_SYS_DIV_CEIL(x, m)
 Integer division with round up (ceil).
#define C4E_ASSERT(cond)
 Assert condition cond, else exit program.
#define C4E_SYS_CAST(type, any)
 Cast of any expression to a specific type.
#define C4E_SYS_CAST_UINT8PTR(any)
 Cast of any expression to a C4eArchUint8 pointer.
Error Numbers



#define C4E_STATUS_OK
#define C4E_STATUS_ERNG
#define C4E_STATUS_EMOD
#define C4E_STATUS_EKEYPRV
#define C4E_STATUS_EKEYPUB
#define C4E_STATUS_ELENGTH
#define C4E_STATUS_ECODING
#define C4E_STATUS_EASN1
#define C4E_STATUS_EVERIFY
#define C4E_STATUS_EDOM
#define C4E_STATUS_ERANGE

Typedefs

typedef C4eArchUint C4eSysStatus
typedef int C4eSysBool
 Boolean type.

Detailed Description

System-wide used (common) types, defines and macros.

Author:
Copyright (C) 2007-2015 Ralf Hoppe <ralf.hoppe@ieee.org>
Version:
Id
c4e_sys.h 554 2015-03-09 16:50:11Z ralf

Definition in file c4e_sys.h.


Define Documentation

#define C4E_SYS_UINT8_ZERO

Number zero (0) as type C4eArchUint8

Definition at line 105 of file c4e_sys.h.

#define C4E_SYS_UINT8_ONE

Number one (1) as type C4eArchUint8

Definition at line 111 of file c4e_sys.h.

#define C4E_SYS_DIGIT_ZERO

Number zero (0) as type C4eArchDigit

Definition at line 117 of file c4e_sys.h.

#define C4E_SYS_DIGIT_ONE

Number one (1) as type C4eArchDigit

Definition at line 123 of file c4e_sys.h.

#define C4E_SYS_DIGIT_MAX

Maximum value of an C4eArchDigit

See also:
C4eArchDigit

Definition at line 131 of file c4e_sys.h.

#define C4E_SYS_DIGIT_BITS

Size of a digit in bits

See also:
C4eArchDigit

Definition at line 139 of file c4e_sys.h.

#define C4E_SYS_DIGIT_MSBIT

Mask for the most significant bit in a C4eArchDigit.

See also:
C4eArchDigit

Definition at line 147 of file c4e_sys.h.

#define C4E_SYS_DIGIT_LSBYTE

Mask for the least significant byte in a C4eArchDigit.

See also:
C4eArchDigit

Definition at line 156 of file c4e_sys.h.

#define C4E_SYS_DIGIT_MSBYTE

Mask for the most significant byte in a C4eArchDigit.

See also:
C4eArchDigit

Definition at line 165 of file c4e_sys.h.

#define C4E_SYS_VECTOR_SIZE ( vec   ) 

Returns the number of elements in a vector (array).

Parameters:
[in] vec C language array (pointer).
Returns:
The number of elements in vec, determined from sizeof().

Definition at line 182 of file c4e_sys.h.

#define C4E_SYS_DIV_CEIL ( x,
 ) 

Integer division with round up (ceil).

Parameters:
[in] x Integer number to divide
[in] m Divisor
Returns:
Ceil of x / m

Definition at line 195 of file c4e_sys.h.

#define C4E_ASSERT ( cond   ) 

Assert condition cond, else exit program.

Customize:
Customize to fit your special needs when debugging
Parameters:
[in] cond Condition which must evaluate C4E_TRUE

Definition at line 210 of file c4e_sys.h.

#define C4E_SYS_CAST ( type,
any   ) 

Cast of any expression to a specific type.

Note:
A pointer cast always violates MISRA-C:2004 advisory rule 11.4.
Parameters:
[in] type Target type
[in] any Any expression (most an integral type or pointer)
Returns:
The expression any as type type.

Definition at line 229 of file c4e_sys.h.

#define C4E_SYS_CAST_UINT8PTR ( any   ) 

Cast of any expression to a C4eArchUint8 pointer.

Note:
A pointer cast always violates MISRA-C:2004 advisory rule 11.4.
Parameters:
[in] any Any expression (typically a pointer)
Returns:
The expression any as type C4eArchUint8 *

Definition at line 244 of file c4e_sys.h.