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 AI_RETCODE_H
17#define AI_RETCODE_H
18
19/**
20 * Error code used to communicate between plugin SDK and apps.
21 */
22typedef enum {
23    AI_RETCODE_SUCCESS = 0,                   /** Return code for an operation success */
24    AI_RETCODE_FAILURE = -1,                  /** Return code for an operation failure */
25
26    AI_RETCODE_INIT_ERROR = 1001,             /** Return code for an initialization error */
27    AI_RETCODE_NULL_PARAM = 1002,             /** Return code for a null parameter error */
28    AI_RETCODE_DUPLICATE_INIT_ERROR = 1004,   /** Return code for a duplicate initialization error */
29
30    AI_RETCODE_SERIALIZATION_ERROR = 2001,    /** Return code for a serialization error */
31    AI_RETCODE_UNSERIALIZATION_ERROR = 2002,  /** Return code for a deserialization error */
32
33    AI_RETCODE_PLUGIN_EXECUTION_ERROR = 3001, /** Return code for a plugin execution error */
34    AI_RETCODE_PLUGIN_SESSION_ERROR = 3002,   /** Return code for a plugin session error */
35} AiRetCode;
36
37#endif // AI_RETCODE_H
38