/src/S2OPC/src/ClientServer/services/bgenc/constants.c
Line | Count | Source |
1 | | /* |
2 | | * Licensed to Systerel under one or more contributor license |
3 | | * agreements. See the NOTICE file distributed with this work |
4 | | * for additional information regarding copyright ownership. |
5 | | * Systerel licenses this file to you under the Apache |
6 | | * License, Version 2.0 (the "License"); you may not use this |
7 | | * file except in compliance with the License. You may obtain |
8 | | * a copy of the License at |
9 | | * |
10 | | * http://www.apache.org/licenses/LICENSE-2.0 |
11 | | * |
12 | | * Unless required by applicable law or agreed to in writing, |
13 | | * software distributed under the License is distributed on an |
14 | | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
15 | | * KIND, either express or implied. See the License for the |
16 | | * specific language governing permissions and limitations |
17 | | * under the License. |
18 | | */ |
19 | | |
20 | | /****************************************************************************** |
21 | | |
22 | | File Name : constants.c |
23 | | |
24 | | Date : 18/03/2025 08:06:59 |
25 | | |
26 | | C Translator Version : tradc Java V1.2 (06/02/2022) |
27 | | |
28 | | ******************************************************************************/ |
29 | | |
30 | | /*------------------------ |
31 | | Exported Declarations |
32 | | ------------------------*/ |
33 | | #include "constants.h" |
34 | | |
35 | | /*------------------------ |
36 | | INITIALISATION Clause |
37 | | ------------------------*/ |
38 | 0 | void constants__INITIALISATION(void) { |
39 | 0 | } |
40 | | |
41 | | /*-------------------- |
42 | | OPERATIONS Clause |
43 | | --------------------*/ |
44 | | void constants__read_cast_t_ReadValue( |
45 | | const t_entier4 constants__ii, |
46 | 0 | constants__t_ReadValue_i * const constants__rvi) { |
47 | 0 | *constants__rvi = constants__ii; |
48 | 0 | } |
49 | | |
50 | | void constants__get_cast_t_WriteValue( |
51 | | const t_entier4 constants__ii, |
52 | 0 | constants__t_WriteValue_i * const constants__wvi) { |
53 | 0 | *constants__wvi = constants__ii; |
54 | 0 | } |
55 | | |
56 | | void constants__get_cast_t_BrowseValue( |
57 | | const t_entier4 constants__p_ind, |
58 | 0 | constants__t_BrowseValue_i * const constants__p_bvi) { |
59 | 0 | *constants__p_bvi = constants__p_ind; |
60 | 0 | } |
61 | | |
62 | | void constants__get_Is_Dir_Forward_Compatible( |
63 | | const constants__t_BrowseDirection_i constants__p_dir, |
64 | | const t_bool constants__p_IsForward, |
65 | 0 | t_bool * const constants__p_dir_compat) { |
66 | 0 | switch (constants__p_dir) { |
67 | 0 | case constants__e_bd_forward: |
68 | 0 | *constants__p_dir_compat = constants__p_IsForward; |
69 | 0 | break; |
70 | 0 | case constants__e_bd_inverse: |
71 | 0 | *constants__p_dir_compat = (constants__p_IsForward == false); |
72 | 0 | break; |
73 | 0 | default: |
74 | 0 | *constants__p_dir_compat = true; |
75 | 0 | break; |
76 | 0 | } |
77 | 0 | } |
78 | | |
79 | | void constants__is_included_ValueRank( |
80 | | const t_entier4 constants__p_concValueRank, |
81 | | const t_entier4 constants__p_expValueRank, |
82 | 0 | t_bool * const constants__bres) { |
83 | 0 | if (constants__p_expValueRank == constants__c_ValueRank_ScalarOrOneDimension) { |
84 | 0 | *constants__bres = ((constants__p_concValueRank == constants__c_ValueRank_Scalar) || |
85 | 0 | (constants__p_concValueRank == constants__c_ValueRank_OneDimension)); |
86 | 0 | } |
87 | 0 | else if (constants__p_expValueRank == constants__c_ValueRank_Any) { |
88 | 0 | *constants__bres = true; |
89 | 0 | } |
90 | 0 | else if (constants__p_expValueRank == constants__c_ValueRank_Scalar) { |
91 | 0 | *constants__bres = (constants__p_concValueRank == constants__c_ValueRank_Scalar); |
92 | 0 | } |
93 | 0 | else if (constants__p_expValueRank == constants__c_ValueRank_OneOrMoreDimensions) { |
94 | 0 | *constants__bres = (constants__p_concValueRank >= constants__c_ValueRank_OneDimension); |
95 | 0 | } |
96 | 0 | else { |
97 | 0 | *constants__bres = (constants__p_expValueRank == constants__p_concValueRank); |
98 | 0 | } |
99 | 0 | } |
100 | | |