13f4cbf05Sopenharmony_ci/* 23f4cbf05Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 33f4cbf05Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 43f4cbf05Sopenharmony_ci * you may not use this file except in compliance with the License. 53f4cbf05Sopenharmony_ci * You may obtain a copy of the License at 63f4cbf05Sopenharmony_ci * 73f4cbf05Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 83f4cbf05Sopenharmony_ci * 93f4cbf05Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 103f4cbf05Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 113f4cbf05Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 123f4cbf05Sopenharmony_ci * See the License for the specific language governing permissions and 133f4cbf05Sopenharmony_ci * limitations under the License. 143f4cbf05Sopenharmony_ci */ 153f4cbf05Sopenharmony_ci 163f4cbf05Sopenharmony_ci /** 173f4cbf05Sopenharmony_ci * @file common_event_sys_errors.h 183f4cbf05Sopenharmony_ci * 193f4cbf05Sopenharmony_ci * @brief Provide value of 'Code' segment of ErrCode for 'EventSystem' module in 203f4cbf05Sopenharmony_ci * commonlibrary subsystem. 213f4cbf05Sopenharmony_ci */ 223f4cbf05Sopenharmony_ci 233f4cbf05Sopenharmony_ci#ifndef UTILS_COMMON_EVENT_SYS_ERRORS_H 243f4cbf05Sopenharmony_ci#define UTILS_COMMON_EVENT_SYS_ERRORS_H 253f4cbf05Sopenharmony_ci 263f4cbf05Sopenharmony_ci#include <cerrno> 273f4cbf05Sopenharmony_ci#include "errors.h" 283f4cbf05Sopenharmony_ci#include "common_errors.h" 293f4cbf05Sopenharmony_ci 303f4cbf05Sopenharmony_cinamespace OHOS { 313f4cbf05Sopenharmony_cinamespace Utils { 323f4cbf05Sopenharmony_ci 333f4cbf05Sopenharmony_ci/** 343f4cbf05Sopenharmony_ci * ErrCode layout 353f4cbf05Sopenharmony_ci * 363f4cbf05Sopenharmony_ci * +-----+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 373f4cbf05Sopenharmony_ci * | Bit |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00| 383f4cbf05Sopenharmony_ci * +-----+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 393f4cbf05Sopenharmony_ci * |Field|Reserved| Subsystem | Module | Code | 403f4cbf05Sopenharmony_ci * +-----+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 413f4cbf05Sopenharmony_ci * 423f4cbf05Sopenharmony_ci * In this file, subsystem is "SUBSYS_COMMON" and module is "MODULE_EVENT_SYSTEM". 433f4cbf05Sopenharmony_ci */ 443f4cbf05Sopenharmony_ci 453f4cbf05Sopenharmony_ciusing ErrCode = int; 463f4cbf05Sopenharmony_ci 473f4cbf05Sopenharmony_ci// offset of event system module error, only be used in this file. 483f4cbf05Sopenharmony_ci/** 493f4cbf05Sopenharmony_ci * @brief Base ErrCode of module 'EventSystem' in commonlibrary subsystem. 503f4cbf05Sopenharmony_ci */ 513f4cbf05Sopenharmony_ciconstexpr ErrCode COMMON_EVENT_SYS_ERR_OFFSET = ErrCodeOffset(SUBSYS_COMMON, MODULE_EVENT_SYS); 523f4cbf05Sopenharmony_ci 533f4cbf05Sopenharmony_cienum { 543f4cbf05Sopenharmony_ci EVENT_SYS_ERR_OK = COMMON_EVENT_SYS_ERR_OFFSET + 0, 553f4cbf05Sopenharmony_ci EVENT_SYS_ERR_FAILED = COMMON_EVENT_SYS_ERR_OFFSET + 1, 563f4cbf05Sopenharmony_ci EVENT_SYS_ERR_ALREADY_STARTED = COMMON_EVENT_SYS_ERR_OFFSET + 2, 573f4cbf05Sopenharmony_ci EVENT_SYS_ERR_NOT_FOUND = COMMON_EVENT_SYS_ERR_OFFSET + 3, 583f4cbf05Sopenharmony_ci EVENT_SYS_ERR_BADF = COMMON_EVENT_SYS_ERR_OFFSET + 4, 593f4cbf05Sopenharmony_ci EVENT_SYS_ERR_BADEVENT = COMMON_EVENT_SYS_ERR_OFFSET + 5, 603f4cbf05Sopenharmony_ci EVENT_SYS_ERR_NOEVENT = COMMON_EVENT_SYS_ERR_OFFSET + 6, 613f4cbf05Sopenharmony_ci}; 623f4cbf05Sopenharmony_ci 633f4cbf05Sopenharmony_ci} // Utils 643f4cbf05Sopenharmony_ci} // OHOS 653f4cbf05Sopenharmony_ci 663f4cbf05Sopenharmony_ci#endif 67