xref: /freebsd/contrib/llvm-project/clang/include/clang-c/CXErrorCode.h (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1*0b57cec5SDimitry Andric /*===-- clang-c/CXErrorCode.h - C Index Error Codes  --------------*- C -*-===*\
2*0b57cec5SDimitry Andric |*                                                                            *|
3*0b57cec5SDimitry Andric |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
4*0b57cec5SDimitry Andric |* Exceptions.                                                                *|
5*0b57cec5SDimitry Andric |* See https://llvm.org/LICENSE.txt for license information.                  *|
6*0b57cec5SDimitry Andric |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
7*0b57cec5SDimitry Andric |*                                                                            *|
8*0b57cec5SDimitry Andric |*===----------------------------------------------------------------------===*|
9*0b57cec5SDimitry Andric |*                                                                            *|
10*0b57cec5SDimitry Andric |* This header provides the CXErrorCode enumerators.                          *|
11*0b57cec5SDimitry Andric |*                                                                            *|
12*0b57cec5SDimitry Andric \*===----------------------------------------------------------------------===*/
13*0b57cec5SDimitry Andric 
14*0b57cec5SDimitry Andric #ifndef LLVM_CLANG_C_CXERRORCODE_H
15*0b57cec5SDimitry Andric #define LLVM_CLANG_C_CXERRORCODE_H
16*0b57cec5SDimitry Andric 
17*0b57cec5SDimitry Andric #include "clang-c/Platform.h"
18*0b57cec5SDimitry Andric 
19*0b57cec5SDimitry Andric #ifdef __cplusplus
20*0b57cec5SDimitry Andric extern "C" {
21*0b57cec5SDimitry Andric #endif
22*0b57cec5SDimitry Andric 
23*0b57cec5SDimitry Andric /**
24*0b57cec5SDimitry Andric  * Error codes returned by libclang routines.
25*0b57cec5SDimitry Andric  *
26*0b57cec5SDimitry Andric  * Zero (\c CXError_Success) is the only error code indicating success.  Other
27*0b57cec5SDimitry Andric  * error codes, including not yet assigned non-zero values, indicate errors.
28*0b57cec5SDimitry Andric  */
29*0b57cec5SDimitry Andric enum CXErrorCode {
30*0b57cec5SDimitry Andric   /**
31*0b57cec5SDimitry Andric    * No error.
32*0b57cec5SDimitry Andric    */
33*0b57cec5SDimitry Andric   CXError_Success = 0,
34*0b57cec5SDimitry Andric 
35*0b57cec5SDimitry Andric   /**
36*0b57cec5SDimitry Andric    * A generic error code, no further details are available.
37*0b57cec5SDimitry Andric    *
38*0b57cec5SDimitry Andric    * Errors of this kind can get their own specific error codes in future
39*0b57cec5SDimitry Andric    * libclang versions.
40*0b57cec5SDimitry Andric    */
41*0b57cec5SDimitry Andric   CXError_Failure = 1,
42*0b57cec5SDimitry Andric 
43*0b57cec5SDimitry Andric   /**
44*0b57cec5SDimitry Andric    * libclang crashed while performing the requested operation.
45*0b57cec5SDimitry Andric    */
46*0b57cec5SDimitry Andric   CXError_Crashed = 2,
47*0b57cec5SDimitry Andric 
48*0b57cec5SDimitry Andric   /**
49*0b57cec5SDimitry Andric    * The function detected that the arguments violate the function
50*0b57cec5SDimitry Andric    * contract.
51*0b57cec5SDimitry Andric    */
52*0b57cec5SDimitry Andric   CXError_InvalidArguments = 3,
53*0b57cec5SDimitry Andric 
54*0b57cec5SDimitry Andric   /**
55*0b57cec5SDimitry Andric    * An AST deserialization error has occurred.
56*0b57cec5SDimitry Andric    */
57*0b57cec5SDimitry Andric   CXError_ASTReadError = 4
58*0b57cec5SDimitry Andric };
59*0b57cec5SDimitry Andric 
60*0b57cec5SDimitry Andric #ifdef __cplusplus
61*0b57cec5SDimitry Andric }
62*0b57cec5SDimitry Andric #endif
63*0b57cec5SDimitry Andric #endif
64*0b57cec5SDimitry Andric 
65