Commit dc6c348c authored by Christian Persch's avatar Christian Persch

lib: Ensure no exceptions escape from the C API

#185
parent 7d97382b
......@@ -58,7 +58,7 @@ private_headers = [
scan_args = [
'--deprecated-guards="VTE_DISABLE_DEPRECATED"',
'--ignore-decorators=_VTE_GNUC_NONNULL\s*\([^)]*\)',
'--ignore-decorators=_VTE_GNUC_NONNULL\s*\([^)]*\)|_VTE_CXX_NOEXCEPT',
]
glib_prefix = glib_dep.get_pkgconfig_variable('prefix')
......
/*
* Copyright © 2020 Christian Persch
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <algorithm>
#include <exception>
#include <type_traits>
namespace vte {
// This is like std::clamp, except that it doesn't throw when
// max_v<min_v, but instead returns min_v in that case.
template<typename T>
constexpr inline T const&
clamp(T const& v,
T const& min_v,
T const& max_v)
{
return std::max(std::min(v, max_v), min_v);
}
#ifdef VTE_DEBUG
void log_exception(char const* func = __builtin_FUNCTION(),
char const* filename = __builtin_FILE(),
int const line = __builtin_LINE()) noexcept;
#else
inline void log_exception() noexcept { }
#endif
} // namespace vte
......@@ -60,6 +60,7 @@ _vte_debug_init(void)
{ "ringview", VTE_DEBUG_RINGVIEW },
{ "bidi", VTE_DEBUG_BIDI },
{ "conversion", VTE_DEBUG_CONVERSION },
{ "exceptions", VTE_DEBUG_EXCEPTIONS },
};
_vte_debug_flags = g_parse_debug_string (g_getenv("VTE_DEBUG"),
......
......@@ -67,6 +67,7 @@ typedef enum {
VTE_DEBUG_RINGVIEW = 1 << 27,
VTE_DEBUG_BIDI = 1 << 28,
VTE_DEBUG_CONVERSION = 1 << 29,
VTE_DEBUG_EXCEPTIONS = 1 << 30,
} VteDebugFlags;
void _vte_debug_init(void);
......
......@@ -24,6 +24,8 @@
#include <glib.h>
#include "cxx-utils.hh"
namespace vte::glib {
template <typename T, typename D, D d>
......@@ -219,9 +221,16 @@ private:
guint m_source_id{0};
bool m_rescheduled{false};
bool dispatch() noexcept {
bool dispatch() noexcept
{
auto const id = m_source_id;
auto const rv = m_callback();
auto rv = false;
try {
rv = m_callback();
} catch (...) {
vte::log_exception();
}
/* The Timer may have been re-scheduled or removed from within
* the callback. In this case, the callback must return false!
......@@ -264,4 +273,12 @@ private:
}
};
bool set_error_from_exception(GError** error
#ifdef VTE_DEBUG
, char const* func = __builtin_FUNCTION()
, char const* filename = __builtin_FILE()
, int const line = __builtin_LINE()
#endif
) noexcept;
} // namespace vte::glib
/*
* Copyright © 2020 Christian Persch
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <glib-object.h>
namespace vte::glib {
class FreezeObjectNotify {
public:
explicit FreezeObjectNotify(void* object) noexcept
: m_object{G_OBJECT(object)}
{
g_object_freeze_notify(m_object);
}
~FreezeObjectNotify() noexcept
{
g_object_thaw_notify(m_object);
}
FreezeObjectNotify() = delete;
FreezeObjectNotify(FreezeObjectNotify const&) = delete;
FreezeObjectNotify(FreezeObjectNotify&&) = delete;
FreezeObjectNotify& operator=(FreezeObjectNotify const&) = delete;
FreezeObjectNotify& operator=(FreezeObjectNotify&&) = delete;
auto get() const noexcept { return m_object; }
private:
GObject* m_object;
}; // class FreezeObjectNotify
} // namespace vte::glib
......@@ -103,6 +103,8 @@ libvte_common_sources = debug_sources + glib_glue_sources + libc_glue_sources +
'chunk.cc',
'chunk.hh',
'color-triple.hh',
'cxx-utils.hh',
'gobject-glue.hh',
'keymap.cc',
'keymap.h',
'missing.cc',
......
......@@ -64,6 +64,8 @@
#include "marshal.h"
#include "vtepty.h"
#include "vtegtk.hh"
#include "cxx-utils.hh"
#include "gobject-glue.hh"
#ifdef WITH_A11Y
#include "vteaccess.h"
......@@ -96,8 +98,8 @@ static void add_process_timeout(vte::terminal::Terminal* that);
static void add_update_timeout(vte::terminal::Terminal* that);
static void remove_update_timeout(vte::terminal::Terminal* that);
static gboolean process_timeout (gpointer data);
static gboolean update_timeout (gpointer data);
static gboolean process_timeout (gpointer data) noexcept;
static gboolean update_timeout (gpointer data) noexcept;
static cairo_region_t *vte_cairo_get_clip_region (cairo_t *cr);
/* these static variables are guarded by the GDK mutex */
......@@ -688,7 +690,7 @@ Terminal::invalidate_cursor_once(bool periodic)
/* Invalidate the cursor repeatedly. */
// FIXMEchpe this continually adds and removes the blink timeout. Find a better solution
bool
Terminal::cursor_blink_timer_callback() noexcept
Terminal::cursor_blink_timer_callback()
{
m_cursor_blink_state = !m_cursor_blink_state;
m_cursor_blink_time += m_cursor_blink_cycle;
......@@ -834,7 +836,7 @@ Terminal::queue_child_exited()
}
bool
Terminal::child_exited_eos_wait_callback() noexcept
Terminal::child_exited_eos_wait_callback()
{
/* If we get this callback, there has been some time elapsed
* after child-exited, but no EOS yet. This happens for example
......@@ -1813,7 +1815,7 @@ Terminal::emit_adjustment_changed()
auto vadjustment = m_vadjustment.get();
g_object_freeze_notify(G_OBJECT(vadjustment));
auto const freezer = vte::glib::FreezeObjectNotify{vadjustment};
v = _vte_ring_delta (m_screen->row_data);
current = gtk_adjustment_get_lower(vadjustment);
......@@ -1869,8 +1871,6 @@ Terminal::emit_adjustment_changed()
changed = true;
}
g_object_thaw_notify(G_OBJECT(vadjustment));
if (changed)
_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting adjustment_changed.\n");
......@@ -3086,11 +3086,16 @@ static void
reaper_child_exited_cb(VteReaper *reaper,
int ipid,
int status,
vte::terminal::Terminal* that)
vte::terminal::Terminal* that) noexcept
try
{
that->child_watch_done(pid_t{ipid}, status);
// @that might be destroyed at this point
}
catch (...)
{
vte::log_exception();
}
void
Terminal::child_watch_done(pid_t pid,
......@@ -3276,8 +3281,7 @@ Terminal::watch_child (pid_t child_pid)
if (!pty())
return;
GObject *object = G_OBJECT(m_terminal);
g_object_freeze_notify(object);
auto const freezer = vte::glib::FreezeObjectNotify{m_terminal};
/* Set this as the child's pid. */
m_pty_pid = child_pid;
......@@ -3301,8 +3305,6 @@ Terminal::watch_child (pid_t child_pid)
}
/* FIXMEchpe: call set_size() here? */
g_object_thaw_notify(object);
}
/* Reset the input method context. */
......@@ -6725,7 +6727,7 @@ Terminal::select_all()
}
bool
Terminal::mouse_autoscroll_timer_callback() noexcept
Terminal::mouse_autoscroll_timer_callback()
{
bool extend = false;
long x, y, xmax, ymax;
......@@ -7595,10 +7597,15 @@ Terminal::set_size(long columns,
/* Redraw the widget. */
static void
vte_terminal_vadjustment_value_changed_cb(vte::terminal::Terminal* that)
vte_terminal_vadjustment_value_changed_cb(vte::terminal::Terminal* that) noexcept
try
{
that->vadjustment_value_changed();
}
catch (...)
{
vte::log_exception();
}
void
Terminal::vadjustment_value_changed()
......@@ -8142,7 +8149,7 @@ Terminal::determine_cursor_colors(VteCell const* cell,
// FIXMEchpe this constantly removes and reschedules the timer. improve this!
bool
Terminal::text_blink_timer_callback() noexcept
Terminal::text_blink_timer_callback()
{
invalidate_all();
return false; /* don't run again */
......@@ -9824,8 +9831,7 @@ Terminal::reset(bool clear_tabstops,
if (from_api && !m_input_enabled)
return;
GObject *object = G_OBJECT(m_terminal);
g_object_freeze_notify(object);
auto const freezer = vte::glib::FreezeObjectNotify{m_terminal};
m_bell_pending = false;
......@@ -9918,8 +9924,6 @@ Terminal::reset(bool clear_tabstops,
/* Reset XTerm window controls */
m_xterm_wm_iconified = false;
g_object_thaw_notify(object);
}
void
......@@ -10134,8 +10138,7 @@ Terminal::start_processing()
void
Terminal::emit_pending_signals()
{
GObject *object = G_OBJECT(m_terminal);
g_object_freeze_notify(object);
auto const freezer = vte::glib::FreezeObjectNotify{m_terminal};
emit_adjustment_changed();
......@@ -10145,8 +10148,8 @@ Terminal::emit_pending_signals()
_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `window-title-changed'.\n");
g_signal_emit(object, signals[SIGNAL_WINDOW_TITLE_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_WINDOW_TITLE]);
g_signal_emit(freezer.get(), signals[SIGNAL_WINDOW_TITLE_CHANGED], 0);
g_object_notify_by_pspec(freezer.get(), pspecs[PROP_WINDOW_TITLE]);
}
m_window_title_pending.clear();
......@@ -10159,8 +10162,8 @@ Terminal::emit_pending_signals()
_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `current-directory-uri-changed'.\n");
g_signal_emit(object, signals[SIGNAL_CURRENT_DIRECTORY_URI_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_CURRENT_DIRECTORY_URI]);
g_signal_emit(freezer.get(), signals[SIGNAL_CURRENT_DIRECTORY_URI_CHANGED], 0);
g_object_notify_by_pspec(freezer.get(), pspecs[PROP_CURRENT_DIRECTORY_URI]);
}
m_current_directory_uri_pending.clear();
......@@ -10173,8 +10176,8 @@ Terminal::emit_pending_signals()
_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `current-file-uri-changed'.\n");
g_signal_emit(object, signals[SIGNAL_CURRENT_FILE_URI_CHANGED], 0);
g_object_notify_by_pspec(object, pspecs[PROP_CURRENT_FILE_URI]);
g_signal_emit(freezer.get(), signals[SIGNAL_CURRENT_FILE_URI_CHANGED], 0);
g_object_notify_by_pspec(freezer.get(), pspecs[PROP_CURRENT_FILE_URI]);
}
m_current_file_uri_pending.clear();
......@@ -10186,7 +10189,7 @@ Terminal::emit_pending_signals()
if (m_cursor_moved_pending) {
_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `cursor-moved'.\n");
g_signal_emit(object, signals[SIGNAL_CURSOR_MOVED], 0);
g_signal_emit(freezer.get(), signals[SIGNAL_CURSOR_MOVED], 0);
m_cursor_moved_pending = false;
}
if (m_text_modified_flag) {
......@@ -10232,8 +10235,6 @@ Terminal::emit_pending_signals()
m_bell_pending = false;
}
g_object_thaw_notify(object);
auto const eos = m_eos_pending;
if (m_eos_pending) {
queue_eof();
......@@ -10292,7 +10293,8 @@ Terminal::process(bool emit_adj_changed)
* It makes sure initial output is never delayed by more than DISPLAY_TIMEOUT
*/
static gboolean
process_timeout (gpointer data)
process_timeout (gpointer data) noexcept
try
{
GList *l, *next;
gboolean again;
......@@ -10347,6 +10349,11 @@ process_timeout (gpointer data)
return again;
}
catch (...)
{
vte::log_exception();
return true; // false?
}
bool
Terminal::invalidate_dirty_rects_and_process_updates()
......@@ -10445,7 +10452,8 @@ update_repeat_timeout (gpointer data)
}
static gboolean
update_timeout (gpointer data)
update_timeout (gpointer data) noexcept
try
{
GList *l, *next;
......@@ -10485,6 +10493,11 @@ update_timeout (gpointer data)
return FALSE;
}
catch (...)
{
vte::log_exception();
return true; // false?
}
bool
Terminal::write_contents_sync (GOutputStream *stream,
......
......@@ -25,6 +25,7 @@
#include "vteterminal.h"
#include "vtepty.h"
#include "vtemacros.h"
#ifndef VTE_DISABLE_DEPRECATION_WARNINGS
#define _VTE_DEPRECATED G_DEPRECATED
......@@ -38,25 +39,25 @@ _VTE_DEPRECATED
_VTE_PUBLIC
int vte_terminal_match_add_gregex(VteTerminal *terminal,
GRegex *gregex,
GRegexMatchFlags gflags) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
GRegexMatchFlags gflags) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
_VTE_DEPRECATED
_VTE_PUBLIC
void vte_terminal_match_set_cursor(VteTerminal *terminal,
int tag,
GdkCursor *cursor) _VTE_GNUC_NONNULL(1);
GdkCursor *cursor) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
void vte_terminal_match_set_cursor_type(VteTerminal *terminal,
int tag,
GdkCursorType cursor_type) _VTE_GNUC_NONNULL(1);
GdkCursorType cursor_type) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
char *vte_terminal_match_check(VteTerminal *terminal,
glong column, glong row,
int *tag) _VTE_GNUC_NONNULL(1) G_GNUC_MALLOC;
int *tag) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) G_GNUC_MALLOC;
_VTE_DEPRECATED
_VTE_PUBLIC
......@@ -65,17 +66,17 @@ gboolean vte_terminal_event_check_gregex_simple(VteTerminal *terminal,
GRegex **regexes,
gsize n_regexes,
GRegexMatchFlags match_flags,
char **matches) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
char **matches) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
_VTE_DEPRECATED
_VTE_PUBLIC
void vte_terminal_search_set_gregex (VteTerminal *terminal,
GRegex *gregex,
GRegexMatchFlags gflags) _VTE_GNUC_NONNULL(1);
GRegexMatchFlags gflags) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
GRegex *vte_terminal_search_get_gregex (VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
GRegex *vte_terminal_search_get_gregex (VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
......@@ -89,78 +90,78 @@ gboolean vte_terminal_spawn_sync(VteTerminal *terminal,
gpointer child_setup_data,
GPid *child_pid /* out */,
GCancellable *cancellable,
GError **error) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(4);
GError **error) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(4);
_VTE_DEPRECATED
_VTE_PUBLIC
void vte_pty_close (VtePty *pty) _VTE_GNUC_NONNULL(1);
void vte_pty_close (VtePty *pty) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
void vte_terminal_copy_clipboard(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
void vte_terminal_copy_clipboard(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
void vte_terminal_get_geometry_hints(VteTerminal *terminal,
GdkGeometry *hints,
int min_rows,
int min_columns) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
int min_columns) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
_VTE_DEPRECATED
_VTE_PUBLIC
void vte_terminal_set_geometry_hints_for_window(VteTerminal *terminal,
GtkWindow *window) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
GtkWindow *window) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
_VTE_DEPRECATED
_VTE_PUBLIC
const char *vte_terminal_get_icon_title(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
const char *vte_terminal_get_icon_title(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
gboolean vte_terminal_set_encoding(VteTerminal *terminal,
const char *codeset,
GError **error) _VTE_GNUC_NONNULL(1);
GError **error) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
const char *vte_terminal_get_encoding(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
const char *vte_terminal_get_encoding(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
char *vte_terminal_get_text_include_trailing_spaces(VteTerminal *terminal,
VteSelectionFunc is_selected,
gpointer user_data,
GArray *attributes) _VTE_GNUC_NONNULL(1) G_GNUC_MALLOC;
GArray *attributes) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) G_GNUC_MALLOC;
_VTE_DEPRECATED
_VTE_PUBLIC
void vte_terminal_set_rewrap_on_resize(VteTerminal *terminal,
gboolean rewrap) _VTE_GNUC_NONNULL(1);
gboolean rewrap) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
gboolean vte_terminal_get_rewrap_on_resize(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
gboolean vte_terminal_get_rewrap_on_resize(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
void vte_terminal_set_allow_bold(VteTerminal *terminal,
gboolean allow_bold) _VTE_GNUC_NONNULL(1);
gboolean allow_bold) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
gboolean vte_terminal_get_allow_bold(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
gboolean vte_terminal_get_allow_bold(VteTerminal *terminal) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
void vte_terminal_feed_child_binary(VteTerminal *terminal,
const guint8 *data,
gsize length) _VTE_GNUC_NONNULL(1);
gsize length) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_DEPRECATED
_VTE_PUBLIC
char **vte_get_encodings(gboolean include_aliases);
char **vte_get_encodings(gboolean include_aliases) _VTE_CXX_NOEXCEPT;
_VTE_DEPRECATED
_VTE_PUBLIC
gboolean vte_get_encoding_supported(const char *encoding);
gboolean vte_get_encoding_supported(const char *encoding) _VTE_CXX_NOEXCEPT;
G_END_DECLS
......
......@@ -26,16 +26,16 @@
G_BEGIN_DECLS
_VTE_PUBLIC
char *vte_get_user_shell(void);
char *vte_get_user_shell(void) _VTE_CXX_NOEXCEPT;
_VTE_PUBLIC
const char *vte_get_features (void);
const char *vte_get_features (void) _VTE_CXX_NOEXCEPT;
#define VTE_TEST_FLAGS_NONE (G_GUINT64_CONSTANT(0))
#define VTE_TEST_FLAGS_ALL (~G_GUINT64_CONSTANT(0))
_VTE_PUBLIC
void vte_set_test_flags(guint64 flags);
void vte_set_test_flags(guint64 flags) _VTE_CXX_NOEXCEPT;
G_END_DECLS
......
......@@ -41,4 +41,13 @@
#define _VTE_PUBLIC __attribute__((__visibility__("default"))) extern
#if defined(VTE_COMPILATION) && defined(__cplusplus)
#if __cplusplus >= 201103L
#define _VTE_CXX_NOEXCEPT noexcept
#endif
#endif
#ifndef _VTE_CXX_NOEXCEPT
#define _VTE_CXX_NOEXCEPT
#endif
#endif /* __VTE_VTE_MACROS_H__ */
......@@ -35,7 +35,7 @@ G_BEGIN_DECLS
#define VTE_SPAWN_REQUIRE_SYSTEMD_SCOPE (1 << 27)
_VTE_PUBLIC
GQuark vte_pty_error_quark (void);
GQuark vte_pty_error_quark (void) _VTE_CXX_NOEXCEPT;
/**
* VTE_PTY_ERROR:
......@@ -63,35 +63,35 @@ GType vte_pty_get_type (void);
_VTE_PUBLIC
VtePty *vte_pty_new_sync (VtePtyFlags flags,
GCancellable *cancellable,
GError **error);
GError **error) _VTE_CXX_NOEXCEPT;
_VTE_PUBLIC
VtePty *vte_pty_new_foreign_sync (int fd,
GCancellable *cancellable,
GError **error);
GError **error) _VTE_CXX_NOEXCEPT;
_VTE_PUBLIC
int vte_pty_get_fd (VtePty *pty) _VTE_GNUC_NONNULL(1);
int vte_pty_get_fd (VtePty *pty) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_PUBLIC
void vte_pty_child_setup (VtePty *pty) _VTE_GNUC_NONNULL(1);
void vte_pty_child_setup (VtePty *pty) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_PUBLIC
gboolean vte_pty_get_size (VtePty *pty,
int *rows,
int *columns,
GError **error) _VTE_GNUC_NONNULL(1);
GError **error) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_PUBLIC
gboolean vte_pty_set_size (VtePty *pty,
int rows,
int columns,
GError **error) _VTE_GNUC_NONNULL(1);
GError **error) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_PUBLIC
gboolean vte_pty_set_utf8 (VtePty *pty,
gboolean utf8,
GError **error) _VTE_GNUC_NONNULL(1);
GError **error) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(VtePty, g_object_unref)
......@@ -107,7 +107,7 @@ void vte_pty_spawn_async(VtePty *pty,
int timeout,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(3);
gpointer user_data) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(3);
_VTE_PUBLIC
void vte_pty_spawn_with_fds_async(VtePty *pty,
......@@ -125,12 +125,12 @@ void vte_pty_spawn_with_fds_async(VtePty *pty,
int timeout,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(3);
gpointer user_data) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(3);
gboolean vte_pty_spawn_finish(VtePty *pty,
GAsyncResult *result,
GPid *child_pid /* out */,
GError **error) _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
GError **error) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1) _VTE_GNUC_NONNULL(2);
G_END_DECLS
......
......@@ -45,34 +45,34 @@ GQuark vte_regex_error_quark (void);
#define VTE_REGEX_FLAGS_DEFAULT (0x00080000u | 0x40000000u | 0x00100000u)
_VTE_PUBLIC
VteRegex *vte_regex_ref (VteRegex *regex) _VTE_GNUC_NONNULL(1);
VteRegex *vte_regex_ref (VteRegex *regex) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_PUBLIC
VteRegex *vte_regex_unref (VteRegex *regex) _VTE_GNUC_NONNULL(1);
VteRegex *vte_regex_unref (VteRegex *regex) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_PUBLIC
VteRegex *vte_regex_new_for_match (const char *pattern,
gssize pattern_length,
guint32 flags,
GError **error) _VTE_GNUC_NONNULL(1);
GError **error) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_PUBLIC
VteRegex *vte_regex_new_for_search (const char *pattern,
gssize pattern_length,
guint32 flags,
GError **error) _VTE_GNUC_NONNULL(1);
GError **error) _VTE_CXX_NOEXCEPT _VTE_GNUC_NONNULL(1);
_VTE_PUBLIC