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 /**
17  * @file common_errors.h
18  *
19  * @brief Provides values of the <b>Module</b> segment in <b>ErrCode</b>
20  * for all modules in the commonlibrary subsystem.
21  */
22
23#ifndef UTILS_COMMON_ERRORS_H
24#define UTILS_COMMON_ERRORS_H
25
26namespace OHOS {
27namespace Utils {
28
29/**
30 * ErrCode layout
31 *
32 * +-----+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
33 * | 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|
34 * +-----+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
35 * |Field|Reserved|        Subsystem      |  Module      |                  Code                         |
36 * +-----+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
37 *
38 * In this file, the subsystem is "SUBSYS_COMMON".
39 */
40
41/**
42 * @brief Enumerates the values of the <b>Module</b> segment of ErrCode
43 * for modules in the commonlibrary subsystem.
44 *
45 * @var MODULE_DEFAULT Default
46 * @var MODULE_TIMER Timer(timer.h)
47 */
48enum {
49    MODULE_DEFAULT              = 0,
50    MODULE_TIMER                = 1,
51    MODULE_MAPPED_FILE          = 2,
52    MODULE_EVENT_SYS            = 3,
53    // new module
54};
55
56} // Utils
57} // OHOS
58
59#endif
60