1 /* 2 * Copyright (c) 2021 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 HISYSEVENT_DEF_H 17 #define HISYSEVENT_DEF_H 18 19 namespace OHOS { 20 namespace HiviewDFX { 21 static constexpr int SUCCESS = 0; 22 23 static constexpr int ERR_DOMAIN_NAME_INVALID = -1; 24 static constexpr int ERR_EVENT_NAME_INVALID = -2; 25 static constexpr int ERR_DOES_NOT_INIT = -3; 26 static constexpr int ERR_OVER_SIZE = -4; 27 static constexpr int ERR_SEND_FAIL = -5; 28 static constexpr char ERR_MSG_LEVEL0[][32] = { 29 "invalid domain name", 30 "invalid event name", 31 "socket init error", 32 "over size", 33 "send data failed" 34 }; 35 36 static constexpr int ERR_KEY_NAME_INVALID = 1; 37 static constexpr int ERR_VALUE_LENGTH_TOO_LONG = 2; 38 static constexpr int ERR_KEY_NUMBER_TOO_MUCH = 3; 39 static constexpr int ERR_ARRAY_TOO_MUCH = 4; 40 static constexpr char ERR_MSG_LEVEL1[][32] = { 41 "invalid key name", 42 "string value too long", 43 "too many keys (>128)", 44 "too many array items (>100)" 45 }; 46 47 static constexpr unsigned int MAX_DOMAIN_LENGTH = 16; 48 static constexpr unsigned int MAX_EVENT_NAME_LENGTH = 32; 49 static constexpr unsigned int MAX_PARAM_NAME_LENGTH = 48; 50 static constexpr unsigned int MAX_ARRAY_SIZE = 100; 51 static constexpr unsigned int MAX_PARAM_NUMBER = 128; 52 static constexpr unsigned int MAX_STRING_LENGTH = 256 * 1024; 53 static constexpr unsigned int MAX_DATA_SIZE = 384 * 1024; 54 } // HiviewDFX 55 } // OHOS 56 57 #endif // HISYSEVENT_DEF_H 58