lib/iec_types.h
author etisserant
Sat, 28 Jun 2008 19:03:08 +0200
changeset 126 5c658ecdf6b1
parent 59 37ba6f9e51e2
child 137 9ceda59abd27
permissions -rw-r--r--
*** empty log message ***
59
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
     1
#include <limits.h>
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
     2
#include <float.h>
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
     3
#include <time.h>
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
     4
#include <stdint.h>
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
     5
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
     6
/*********************/
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
     7
/*  IEC Types defs   */
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
     8
/*********************/
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
     9
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    10
typedef uint8_t  IEC_BOOL;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    11
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    12
typedef int8_t    IEC_SINT;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    13
typedef int16_t   IEC_INT;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    14
typedef int32_t   IEC_DINT;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    15
typedef int64_t   IEC_LINT;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    16
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    17
typedef uint8_t    IEC_USINT;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    18
typedef uint16_t   IEC_UINT;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    19
typedef uint32_t   IEC_UDINT;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    20
typedef uint64_t   IEC_ULINT;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    21
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    22
typedef uint8_t    IEC_BYTE;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    23
typedef uint16_t   IEC_WORD;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    24
typedef uint32_t   IEC_DWORD;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    25
typedef uint64_t   IEC_LWORD;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    26
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    27
typedef float    IEC_REAL;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    28
typedef double   IEC_LREAL;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    29
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    30
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    31
#if !defined __timespec_defined
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    32
# define __timespec_defined     1
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    33
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    34
struct timespec
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    35
  {
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    36
    long int tv_sec;            /* Seconds.  */
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    37
    long int tv_nsec;           /* Nanoseconds.  */
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    38
  };
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    39
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    40
#endif
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    41
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    42
typedef struct timespec IEC_TIME;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    43
typedef struct timespec IEC_DATE;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    44
typedef struct timespec IEC_DT;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    45
typedef struct timespec IEC_TOD;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    46
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    47
#define STR_MAX_LEN 40
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    48
typedef int8_t __strlen_t;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    49
typedef struct {
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    50
    __strlen_t len;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    51
    uint8_t body[STR_MAX_LEN];
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    52
} IEC_STRING;
37ba6f9e51e2 Splitted type declaration out of iec std lib, to avoid DWORD, BOOL, TIME ,... clash with windows.h
etisserant
parents:
diff changeset
    53