Sync with 5.3.0
[deliverable/titan.core.git] / core / Types.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2014 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
8 #ifndef TYPES_H
9 #define TYPES_H
10
11 #ifndef __GNUC__
12 /** If a C compiler other than GCC is used the macro below will substitute all
13 * GCC-specific non-standard attributes with an empty string. */
14 #ifndef __attribute__
15 #define __attribute__(arg)
16 #endif
17
18 #else
19
20 #define HAVE_GCC(maj, min) \
21 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
22
23 #endif
24
25 #include <stddef.h>
26
27 /* Generic C types */
28
29 typedef bool boolean;
30 #define FALSE false
31 #define TRUE true
32
33 enum verdicttype { NONE = 0, PASS = 1, INCONC = 2, FAIL = 3, ERROR = 4 };
34 extern const char * const verdict_name[];
35
36 enum alt_status { ALT_UNCHECKED, ALT_YES, ALT_MAYBE, ALT_NO, ALT_REPEAT,
37 ALT_BREAK };
38
39 enum null_type { NULL_VALUE };
40
41 enum asn_null_type { ASN_NULL_VALUE };
42
43 struct universal_char {
44 unsigned char uc_group, uc_plane, uc_row, uc_cell;
45
46 bool is_char() const {
47 return uc_group == 0 && uc_plane == 0 && uc_row == 0 && uc_cell < 128;
48 }
49 };
50
51 typedef int component;
52
53 /** @name Predefined component reference values.
54 @{
55 */
56 #define NULL_COMPREF 0
57 #define MTC_COMPREF 1
58 #define SYSTEM_COMPREF 2
59 #define FIRST_PTC_COMPREF 3
60 #define ANY_COMPREF -1
61 #define ALL_COMPREF -2
62 #define UNBOUND_COMPREF -3
63 /** Pseudo-component for logging when the MTC is executing a controlpart */
64 #define CONTROL_COMPREF -4
65
66 /** @} */
67
68 /** Transport types for port connections */
69
70 enum transport_type_enum {
71 TRANSPORT_LOCAL = 0,
72 TRANSPORT_INET_STREAM = 1,
73 TRANSPORT_UNIX_STREAM = 2,
74 TRANSPORT_NUM = 3
75 };
76
77 /** File descriptor event types */
78
79 enum fd_event_type_enum {
80 FD_EVENT_RD = 1, FD_EVENT_WR = 2, FD_EVENT_ERR = 4
81 };
82
83 /** Structure for storing global identifiers of TTCN-3 definitions */
84
85 struct qualified_name {
86 char *module_name;
87 char *definition_name;
88 };
89
90 /** How a component is identified */
91 enum component_id_selector_enum {
92 COMPONENT_ID_NAME, /**< Identified by name */
93 COMPONENT_ID_COMPREF, /**< Identified by component reference */
94 COMPONENT_ID_ALL, /**< All components */
95 COMPONENT_ID_SYSTEM /**< System component */
96 };
97
98 /** Component identifier.
99 *
100 * This must be a POD because itself is a member of a union
101 * (%union in config_process.y).
102 */
103 struct component_id_t {
104 /** How the component is identified.
105 * COMPONENT_ID_NAME identifies by name, COMPONENT_ID_COMPREF by number.
106 * Any other selector identifies the component directly.
107 */
108 component_id_selector_enum id_selector;
109 union {
110 component id_compref;
111 char *id_name;
112 };
113 };
114
115 struct namespace_t {
116 const char * const ns;
117 const char * const px;
118 };
119
120 #endif
This page took 0.033269 seconds and 5 git commands to generate.