source: tags/ms_r18q1/CORE/arb_msg.h

Last change on this file was 16763, checked in by westram, 6 years ago
File size: 3.6 KB
Line 
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
30GlobalStringBuffers *GBS_store_global_buffers(void);
31void GBS_restore_global_buffers(GlobalStringBuffers *saved);
32const char *GBS_vglobal_string(const char *templat, va_list parg) __ATTR__VFORMAT(1);
33char *GBS_vglobal_string_copy(const char *templat, va_list parg) __ATTR__VFORMAT(1);
34const char *GBS_global_string_to_buffer(char *buffer, size_t bufsize, const char *templat, ...) __ATTR__FORMAT(3);
35char *GBS_global_string_copy(const char *templat, ...) __ATTR__FORMAT(1);
36const char *GBS_global_string(const char *templat, ...) __ATTR__FORMAT(1);
37const char *GBS_static_string(const char *str);
38GB_ERROR GBK_assert_msg(const char *assertion, const char *file, int linenr);
39GB_ERROR GB_export_error(const char *error);
40GB_ERROR GB_export_errorf(const char *templat, ...) __ATTR__FORMAT(1) __ATTR__DEPRECATED_LATER("use GB_export_error(GBS_global_string(...))");
41GB_ERROR GB_IO_error(const char *action, const char *filename);
42GB_ERROR GB_export_IO_error(const char *action, const char *filename) __ATTR__DEPRECATED_TODO("use GB_export_error(GB_IO_error(...))");
43GB_ERROR GB_print_error(void) __ATTR__DEPRECATED_TODO("will be removed completely");
44GB_ERROR GB_get_error(void) __ATTR__DEPRECATED_TODO("consider using either GB_await_error() or GB_incur_error()");
45bool GB_have_error(void);
46GB_ERROR GB_await_error(void);
47void GB_clear_error(void);
48
49inline GB_ERROR GB_incur_error() {
50    /*! Take over responsibility for any potential (exported) error.
51     * @return NULp if no error was exported; the error otherwise
52     * Postcondition: no error is exported
53     */
54    return GB_have_error() ? GB_await_error() : NULp;
55}
56inline GB_ERROR GB_incur_error_if(bool error_may_occur) {
57    /*! similar to GB_incur_error.
58     * Additionally asserts no error may occur if 'error_may_occur' is false!
59     */
60    arb_assert(implicated(!error_may_occur, !GB_have_error()));
61    return error_may_occur ? GB_incur_error() : NULp;
62}
63
64GB_ERROR GB_failedTo_error(const char *do_something, const char *special, GB_ERROR error);
65GB_ERROR GB_append_exportedError(GB_ERROR error);
66class BackTraceInfo *GBK_get_backtrace(size_t skipFramesAtBottom);
67void GBK_dump_former_backtrace(class BackTraceInfo *trace, FILE *out, const char *message);
68void GBK_free_backtrace(class BackTraceInfo *trace);
69void GBK_dump_backtrace(FILE *out, const char *message);
70void GB_internal_error(const char *message);
71void GB_internal_errorf(const char *templat, ...) __ATTR__FORMAT(1);
72void GBK_terminate(const char *error) __ATTR__NORETURN;
73void GBK_terminatef(const char *templat, ...) __ATTR__FORMAT(1) __ATTR__NORETURN;
74
75inline void GBK_terminate_on_error(const char *error) { if (error) GBK_terminatef("Fatal error: %s", error); }
76
77void GB_warning(const char *message);
78void GB_warningf(const char *templat, ...) __ATTR__FORMAT(1);
79void GB_information(const char *message);
80void GB_informationf(const char *templat, ...) __ATTR__FORMAT(1);
81void GBS_reuse_buffer(const char *global_buffer);
82GB_ERROR GBK_system(const char *system_command) __ATTR__USERESULT;
83char *GBK_singlequote(const char *arg);
84char *GBK_doublequote(const char *arg);
85
86#else
87#error arb_msg.h included twice
88#endif /* ARB_MSG_H */
Note: See TracBrowser for help on using the repository browser.