WPILibC++ 2027.0.0-alpha-3
Loading...
Searching...
No Matches
status.h
Go to the documentation of this file.
1// Protocol Buffers - Google's data interchange format
2// Copyright 2023 Google LLC. All rights reserved.
3//
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file or at
6// https://developers.google.com/open-source/licenses/bsd
7
8#ifndef UPB_BASE_STATUS_H_
9#define UPB_BASE_STATUS_H_
10
11#include <stdarg.h>
12
13// Must be last.
14#include "upb/port/def.inc"
15
16#define _kUpb_Status_MaxMessage 511
17
18typedef struct {
19 bool ok;
20 char msg[_kUpb_Status_MaxMessage]; // Error message; NULL-terminated.
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27UPB_API const char* upb_Status_ErrorMessage(const upb_Status* status);
29
30// These are no-op if |status| is NULL.
32void upb_Status_SetErrorMessage(upb_Status* status, const char* msg);
33void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...)
34 UPB_PRINTF(2, 3);
35void upb_Status_VSetErrorFormat(upb_Status* status, const char* fmt,
36 va_list args) UPB_PRINTF(2, 0);
37void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
38 va_list args) UPB_PRINTF(2, 0);
39
40#ifdef __cplusplus
41} /* extern "C" */
42#endif
43
44#include "upb/port/undef.inc"
45
46#endif /* UPB_BASE_STATUS_H_ */
#define UPB_PRINTF(str, first_vararg)
Definition def.inc:291
#define UPB_API
Definition def.inc:162
#define _kUpb_Status_MaxMessage
Definition status.h:16
UPB_API bool upb_Status_IsOk(const upb_Status *status)
void upb_Status_SetErrorMessage(upb_Status *status, const char *msg)
UPB_API void upb_Status_Clear(upb_Status *status)
UPB_API const char * upb_Status_ErrorMessage(const upb_Status *status)
void void void upb_Status_VAppendErrorFormat(upb_Status *status, const char *fmt, va_list args) UPB_PRINTF(2
void void upb_Status_VSetErrorFormat(upb_Status *status, const char *fmt, va_list args) UPB_PRINTF(2
void upb_Status_SetErrorFormat(upb_Status *status, const char *fmt,...) UPB_PRINTF(2
Definition status.h:18
bool ok
Definition status.h:19