From fa47eeda2b3c188c4c74119c843b87062fd93061 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 13 Nov 2012 07:19:10 +0100 Subject: added support for string match characters (match spec to regexp compiler) --- sciteco.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'sciteco.h') diff --git a/sciteco.h b/sciteco.h index 0e2a4fd..743edb3 100644 --- a/sciteco.h +++ b/sciteco.h @@ -35,4 +35,23 @@ sptr_t editor_msg(unsigned int iMessage, uptr_t wParam = 0, sptr_t lParam = 0); /* TECO uses only lower 7 bits for commands */ #define MAX_TRANSITIONS 127 -#endif \ No newline at end of file +namespace String { + +static inline void +append(gchar *&str1, const gchar *str2) +{ + /* FIXME: optimize */ + gchar *new_str = g_strconcat(str1 ? : "", str2, NULL); + g_free(str1); + str1 = new_str; +} + +static inline void +append(gchar *&str, gchar chr) +{ + append(str, (gchar []){chr, '\0'}); +} + +} /* namespace String */ + +#endif -- cgit v1.2.3