ARB
arb_msg.h
Go to the documentation of this file.
1 /* This file is generated by aisc_mkpt.
2  * Any changes you make here will be overwritten later!
3  */
4 
5 #ifndef ARB_MSG_H
6 #define ARB_MSG_H
7 
8 /* define ARB attributes: */
9 #ifndef ATTRIBUTES_H
10 # include <attributes.h>
11 #endif
12 
13 
14 /* arb_msg.cxx */
15 
16 #ifndef _GLIBCXX_CSTDLIB
17 #include <cstdlib>
18 #endif
19 #ifndef ARB_CORE_H
20 #include "arb_core.h"
21 #endif
22 #ifndef ARB_ASSERT_H
23 #include "arb_assert.h"
24 #endif
25 
26 // return error and ensure none is exported
27 #define RETURN_ERROR(err) arb_assert(!GB_have_error()); return (err)
28 
29 
32 const char *GBS_vglobal_string(const char *templat, va_list parg) __ATTR__VFORMAT(1);
33 char *GBS_vglobal_string_copy(const char *templat, va_list parg) __ATTR__VFORMAT(1);
34 const char *GBS_global_string_to_buffer(char *buffer, size_t bufsize, const char *templat, ...) __ATTR__FORMAT(3);
35 char *GBS_global_string_copy(const char *templat, ...) __ATTR__FORMAT(1);
36 const char *GBS_global_string(const char *templat, ...) __ATTR__FORMAT(1);
37 const char *GBS_static_string(const char *str);
38 GB_ERROR GBK_assert_msg(const char *assertion, const char *file, int linenr);
39 GB_ERROR GB_export_error(const char *error);
40 GB_ERROR GB_export_errorf(const char *templat, ...) __ATTR__FORMAT(1) __ATTR__DEPRECATED_LATER("use GB_export_error(GBS_global_string(...))");
41 GB_ERROR GB_IO_error(const char *action, const char *filename);
42 GB_ERROR GB_export_IO_error(const char *action, const char *filename) __ATTR__DEPRECATED_TODO("use GB_export_error(GB_IO_error(...))");
43 GB_ERROR GB_print_error(void) __ATTR__DEPRECATED_TODO("will be removed completely");
44 GB_ERROR GB_get_error(void) __ATTR__DEPRECATED_TODO("consider using either GB_await_error() or GB_incur_error()");
45 bool GB_have_error(void);
47 void GB_clear_error(void);
48 
49 inline GB_ERROR GB_incur_error() {
54  return GB_have_error() ? GB_await_error() : NULp;
55 }
56 inline GB_ERROR GB_incur_error_if(bool error_may_occur) {
60  arb_assert(implicated(!error_may_occur, !GB_have_error()));
61  return error_may_occur ? GB_incur_error() : NULp;
62 }
63 
64 GB_ERROR GB_failedTo_error(const char *do_something, const char *special, GB_ERROR error);
66 class BackTraceInfo *GBK_get_backtrace(size_t skipFramesAtBottom);
67 void GBK_dump_former_backtrace(class BackTraceInfo *trace, FILE *out, const char *message);
68 void GBK_free_backtrace(class BackTraceInfo *trace);
69 void GBK_dump_backtrace(FILE *out, const char *message);
70 void GB_internal_error(const char *message);
71 void GB_internal_errorf(const char *templat, ...) __ATTR__FORMAT(1);
72 void GBK_terminate(const char *error) __ATTR__NORETURN;
73 void GBK_terminatef(const char *templat, ...) __ATTR__FORMAT(1) __ATTR__NORETURN;
74 
75 inline void GBK_terminate_on_error(const char *error) { if (error) GBK_terminatef("Fatal error: %s", error); }
76 
77 void GB_warning(const char *message);
78 void GB_warningf(const char *templat, ...) __ATTR__FORMAT(1);
79 void GB_information(const char *message);
80 void GB_informationf(const char *templat, ...) __ATTR__FORMAT(1);
81 void GBS_reuse_buffer(const char *global_buffer);
82 GB_ERROR GBK_system(const char *system_command) __ATTR__USERESULT;
83 char *GBK_singlequote(const char *arg);
84 char *GBK_doublequote(const char *arg);
85 
86 #else
87 #error arb_msg.h included twice
88 #endif /* ARB_MSG_H */
void GB_warningf(const char *templat,...) __ATTR__FORMAT(1)
Definition: arb_msg.cxx:490
#define arb_assert(cond)
Definition: arb_assert.h:245
class BackTraceInfo * GBK_get_backtrace(size_t skipFramesAtBottom)
Definition: arb_msg.cxx:417
#define __ATTR__DEPRECATED_LATER(reason)
Definition: attributes.h:109
char * GBS_global_string_copy(const char *templat,...) __ATTR__FORMAT(1)
Definition: arb_msg.cxx:195
const char * GB_ERROR
Definition: arb_core.h:25
void GBK_terminate_on_error(const char *error)
Definition: arb_msg.h:75
GB_ERROR GB_incur_error()
Definition: arb_msg.h:49
#define implicated(hypothesis, conclusion)
Definition: arb_assert.h:289
GB_ERROR GBK_assert_msg(const char *assertion, const char *file, int linenr)
Definition: arb_msg.cxx:217
GlobalStringBuffers * GBS_store_global_buffers(void)
Definition: arb_msg.cxx:155
void GBK_free_backtrace(class BackTraceInfo *trace)
Definition: arb_msg.cxx:424
char * GBK_doublequote(const char *arg)
Definition: arb_msg.cxx:576
GB_ERROR GB_await_error(void)
Definition: arb_msg.cxx:353
#define __ATTR__FORMAT(pos)
Definition: attributes.h:60
GB_ERROR GB_IO_error(const char *action, const char *filename)
Definition: arb_msg.cxx:293
GB_ERROR GBK_system(const char *system_command) __ATTR__USERESULT
Definition: arb_msg.cxx:519
char * GBK_singlequote(const char *arg)
Definition: arb_msg.cxx:547
GB_ERROR GB_append_exportedError(GB_ERROR error)
Definition: arb_msg.cxx:399
char buffer[MESSAGE_BUFFERSIZE]
Definition: seq_search.cxx:34
GB_ERROR GB_incur_error_if(bool error_may_occur)
Definition: arb_msg.h:56
GB_ERROR GB_failedTo_error(const char *do_something, const char *special, GB_ERROR error)
Definition: arb_msg.cxx:387
void GB_warning(const char *message)
Definition: arb_msg.cxx:484
void GBS_restore_global_buffers(GlobalStringBuffers *saved)
Definition: arb_msg.cxx:161
const char * GBS_static_string(const char *str)
Definition: arb_msg.cxx:213
GB_ERROR GB_export_IO_error(const char *action, const char *filename) __ATTR__DEPRECATED_TODO("use GB_export_error(GB_IO_error(...))")
Definition: arb_msg.cxx:325
__ATTR__VFORMAT(1) static string vstrf(const char *format
void GB_informationf(const char *templat,...) __ATTR__FORMAT(1)
Definition: arb_msg.cxx:502
GB_ERROR GB_print_error(void) __ATTR__DEPRECATED_TODO("will be removed completely")
Definition: arb_msg.cxx:335
GB_ERROR GB_export_errorf(const char *templat,...) __ATTR__FORMAT(1) __ATTR__DEPRECATED_LATER("use GB_export_error(GBS_global_string(...))")
Definition: arb_msg.cxx:264
void message(char *errortext)
void GB_clear_error(void)
Definition: arb_msg.cxx:365
#define __ATTR__DEPRECATED_TODO(reason)
Definition: attributes.h:104
static void error(const char *msg)
Definition: mkptypes.cxx:96
char * GBS_vglobal_string_copy(const char *templat, va_list parg) __ATTR__VFORMAT(1)
Definition: arb_msg.cxx:171
GB_ERROR GB_export_error(const char *error)
Definition: arb_msg.cxx:259
void GBK_dump_backtrace(FILE *out, const char *message)
Definition: arb_msg.cxx:428
void GBK_dump_former_backtrace(class BackTraceInfo *trace, FILE *out, const char *message)
Definition: arb_msg.cxx:420
void GBK_terminatef(const char *templat,...) __ATTR__FORMAT(1) __ATTR__NORETURN
Definition: arb_msg.cxx:477
const char * GBS_global_string(const char *templat,...) __ATTR__FORMAT(1)
Definition: arb_msg.cxx:204
#define __ATTR__USERESULT
Definition: attributes.h:58
void GBK_terminate(const char *error) __ATTR__NORETURN
Definition: arb_msg.cxx:463
const char * GBS_global_string_to_buffer(char *buffer, size_t bufsize, const char *templat,...) __ATTR__FORMAT(3)
Definition: arb_msg.cxx:177
void GBS_reuse_buffer(const char *global_buffer)
Definition: arb_msg.cxx:510
void GB_internal_errorf(const char *templat,...) __ATTR__FORMAT(1)
Definition: arb_msg.cxx:458
#define NULp
Definition: cxxforward.h:97
void GB_internal_error(const char *message)
Definition: arb_msg.cxx:435
void GB_information(const char *message)
Definition: arb_msg.cxx:495
#define __ATTR__NORETURN
Definition: attributes.h:56
bool GB_have_error(void)
Definition: arb_msg.cxx:349
const char * GBS_vglobal_string(const char *templat, va_list parg) __ATTR__VFORMAT(1)
Definition: arb_msg.cxx:166
GB_ERROR GB_get_error(void) __ATTR__DEPRECATED_TODO("consider using either GB_await_error() or GB_incur_error()")
Definition: arb_msg.cxx:344