zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

rich_error.h (1217B) - Raw


      1 #ifndef __XPC_RICH_ERROR_H__
      2 #define __XPC_RICH_ERROR_H__
      3 
      4 #ifndef __XPC_INDIRECT__
      5 #error "Please #include <xpc/xpc.h> instead of this file directly."
      6 // For HeaderDoc.
      7 #include <xpc/base.h>
      8 #endif // __XPC_INDIRECT__
      9 
     10 #ifndef __BLOCKS__
     11 #error "XPC Rich Errors require Blocks support."
     12 #endif // __BLOCKS__
     13 
     14 XPC_ASSUME_NONNULL_BEGIN
     15 __BEGIN_DECLS
     16 
     17 #pragma mark Properties
     18 /*!
     19  * @function xpc_rich_error_copy_description
     20  * Copy the string description of an error.
     21  *
     22  * @param error
     23  * The error to be examined.
     24  *
     25  * @result
     26  * The underlying C string for the provided error. This string should be
     27  * disposed of with free(3) when done.
     28  * 
     29  * This will return NULL if a string description could not be generated.
     30  */
     31 XPC_EXPORT XPC_WARN_RESULT
     32 char * _Nullable
     33 xpc_rich_error_copy_description(xpc_rich_error_t error);
     34 
     35 /*!
     36  * @function xpc_rich_error_can_retry
     37  * Whether the operation the error originated from can be retried.
     38  *
     39  * @param error
     40  * The error to be inspected.
     41  *
     42  * @result
     43  * Whether the operation the error originated from can be retried.
     44  */
     45 XPC_EXPORT XPC_WARN_RESULT
     46 bool
     47 xpc_rich_error_can_retry(xpc_rich_error_t error);
     48 
     49 __END_DECLS
     50 XPC_ASSUME_NONNULL_END
     51 
     52 #endif // __XPC_RICH_ERROR_H__