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_rawdata.h" 25 #include "meta_type.h" 26 27 namespace OHOS { 28 namespace Idl { 29 static constexpr int METADATA_MAGIC_NUMBER = 0x1DF02ED1; 30 31 struct MetaComponent { 32 int magic_; 33 int size_; 34 char* name_; 35 int namespaceNumber_; 36 int sequenceableNumber_; 37 int rawdataNumber_; 38 int interfaceNumber_; 39 int typeNumber_; 40 MetaNamespace** namespaces_; 41 MetaSequenceable** sequenceables_; 42 MetaRawData** rawdatas_; 43 MetaInterface** interfaces_; 44 MetaType** types_; 45 int stringPoolSize_; 46 char* stringPool_; 47 }; 48 49 static constexpr unsigned int INTERFACE_PROPERTY_ONEWAY = 0x1; 50 51 static constexpr unsigned int METHOD_PROPERTY_ONEWAY = 0x1; 52 53 static constexpr unsigned int ATTR_IN = 0x1; 54 static constexpr unsigned int ATTR_OUT = 0x2; 55 static constexpr unsigned int ATTR_MASK = 0x3; 56 } // namespace Idl 57 } // namespace OHOS 58 #endif // OHOS_IDL_METADATA_H 59