File indexing completed on 2025-01-30 10:25:22
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef UPB_BASE_STATUS_H_
0009 #define UPB_BASE_STATUS_H_
0010
0011 #include <stdarg.h>
0012
0013
0014 #include "upb/port/def.inc"
0015
0016 #define _kUpb_Status_MaxMessage 511
0017
0018 typedef struct {
0019 bool ok;
0020 char msg[_kUpb_Status_MaxMessage];
0021 } upb_Status;
0022
0023 #ifdef __cplusplus
0024 extern "C" {
0025 #endif
0026
0027 UPB_API const char* upb_Status_ErrorMessage(const upb_Status* status);
0028 UPB_API bool upb_Status_IsOk(const upb_Status* status);
0029
0030
0031 UPB_API void upb_Status_Clear(upb_Status* status);
0032 void upb_Status_SetErrorMessage(upb_Status* status, const char* msg);
0033 void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...)
0034 UPB_PRINTF(2, 3);
0035 void upb_Status_VSetErrorFormat(upb_Status* status, const char* fmt,
0036 va_list args) UPB_PRINTF(2, 0);
0037 void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
0038 va_list args) UPB_PRINTF(2, 0);
0039
0040 #ifdef __cplusplus
0041 }
0042 #endif
0043
0044 #include "upb/port/undef.inc"
0045
0046 #endif