1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_IDL_METADATA_H
17 #define OHOS_IDL_METADATA_H
18 
19 #include <cstring>
20 
21 #include "meta_interface.h"
22 #include "meta_namespace.h"
23 #include "meta_sequenceable.h"
24 #include "meta_type.h"
25 
26 namespace OHOS {
27 namespace Idl {
28 static constexpr int METADATA_MAGIC_NUMBER = 0x1DF02ED1;
29 
30 struct MetaComponent {
31     int magic_;
32     int size_;
33     char* name_;
34     int namespaceNumber_;
35     int sequenceableNumber_;
36     int interfaceNumber_;
37     int typeNumber_;
38     MetaNamespace** namespaces_;
39     MetaSequenceable** sequenceables_;
40     MetaInterface** interfaces_;
41     MetaType** types_;
42     int stringPoolSize_;
43     char* stringPool_;
44 };
45 
46 static constexpr unsigned int INTERFACE_PROPERTY_ONEWAY = 0x1;
47 
48 static constexpr unsigned int METHOD_PROPERTY_ONEWAY = 0x1;
49 
50 static constexpr unsigned int ATTR_IN = 0x1;
51 static constexpr unsigned int ATTR_OUT = 0x2;
52 static constexpr unsigned int ATTR_MASK = 0x3;
53 } // namespace Idl
54 } // namespace OHOS
55 #endif // OHOS_IDL_METADATA_H
56