Motr  M0
test_gccxml_simple.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * For any questions about this software or licensing,
17  * please email opensource@seagate.com or cortx-questions@seagate.com.
18  *
19  */
20 
21 #pragma once
22 
23 #ifndef __MOTR_XCODE_UT_TEST_GCCXML_SIMPLE_H__
24 #define __MOTR_XCODE_UT_TEST_GCCXML_SIMPLE_H__
25 
26 #ifndef __ENUM_ONLY
27 
28 #ifndef __KERNEL__
29 #include <sys/types.h>
30 #include <stdint.h>
31 #endif
32 
33 #include "xcode/xcode.h"
34 #include "fid/fid.h"
35 #include "fid/fid_xc.h"
36 
37 struct optfid {
38  uint8_t o_flag;
39  union {
40  struct m0_fid o_fid M0_XCA_TAG("1");
41  uint32_t o_short M0_XCA_TAG("3");
42  } u;
43 } M0_XCA_UNION;
44 
45 struct optfidarray {
46  uint64_t ofa_nr;
47  struct optfid *ofa_data;
48 } M0_XCA_SEQUENCE;
49 
50 enum {
51  NR = 9
52 };
53 
54 struct fixarray {
55  m0_void_t fa_none M0_XCA_TAG("NR");
56  struct optfid *fa_data;
57 } M0_XCA_SEQUENCE;
58 
59 struct testtypes {
60  char tt_char;
61  char *tt_pchar;
62  const char *tt_cpchar;
63  int tt_int;
64  long long tt_ll;
65  unsigned int tt_ui;
66  void *tt_buf;
67 } M0_XCA_RECORD;
68 
69 struct inlinearray {
70  /*
71  * M0_XA_ARRAY must contain a single field.
72  *
73  * This field must be an array.
74  */
75  struct testtypes ia_bugs[5];
76 } M0_XCA_ARRAY;
77 
78 #endif /* __ENUM_ONLY */
79 
80 enum testenum {
83  TE_5 = TE_0 + 5,
84  TE_33 = 33
85 } M0_XCA_ENUM;
86 
88  BM_ZERO = 1ULL << 0,
89  BM_SIX = 1ULL << 6,
90  BM_FOUR = 1ULL << 4,
91  BM_NINE = 1ULL << 9,
92  BM_FIVE = 1ULL << 5
93 } M0_XCA_ENUM;
94 
95 struct enumfield {
96  uint64_t ef_0;
97  uint64_t ef_enum M0_XCA_FENUM(testenum);
98  uint64_t ef_bitm M0_XCA_FBITMASK(testbitmask);
99  uint64_t ef_1;
100 } M0_XCA_RECORD;
101 
102 #endif /* __MOTR_XCODE_UT_TEST_GCCXML_SIMPLE_H__ */
struct optfid * ofa_data
uint64_t ef_enum M0_XCA_FENUM(testenum)
#define M0_XCA_TAG(value)
Definition: xcode_attr.h:57
unsigned int tt_ui
struct testtypes ia_bugs[5]
uint8_t o_flag
long long tt_ll
const char * tt_cpchar
m0_void_t fa_none M0_XCA_TAG("NR")
struct optfid * fa_data
uint64_t ef_bitm M0_XCA_FBITMASK(testbitmask)
Definition: fid.h:38
char m0_void_t[0]
Definition: xcode.h:925
union optfid::@535 u
struct inlinearray M0_XCA_ARRAY
testbitmask
enum testenum M0_XCA_ENUM