aboutsummaryrefslogtreecommitdiffhomepage
path: root/sciteco.h
diff options
context:
space:
mode:
Diffstat (limited to 'sciteco.h')
-rw-r--r--sciteco.h21
1 files changed, 20 insertions, 1 deletions
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