diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-02-16 04:40:58 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-02-16 04:40:58 +0100 |
commit | 4ae59fd5cdcaba4d050e86d02c38dddacba2fc80 (patch) | |
tree | 893b43e8602cc17caa1a809d343cc4d27553e879 /src/sciteco.h | |
parent | 340f47ff2162865d93c4e4c47fec0c8584fe8743 (diff) | |
download | sciteco-4ae59fd5cdcaba4d050e86d02c38dddacba2fc80.tar.gz |
rewritten command-line completion without Glib's g_complete_ functions
* they have been marked deprecated in recent libglib versions (since v2.26)
* there is no alternative in recent libglib versions, so we
simply do it with a little string handling.
this works with older and newer libglib versions.
Diffstat (limited to 'src/sciteco.h')
-rw-r--r-- | src/sciteco.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sciteco.h b/src/sciteco.h index 5ea5107..65b8e9a 100644 --- a/src/sciteco.h +++ b/src/sciteco.h @@ -91,6 +91,17 @@ append(gchar *&str, gchar chr) void get_coord(const gchar *str, gint pos, gint &line, gint &column); +static inline gsize +diff(const gchar *a, const gchar *b) +{ + gsize len = 0; + + while (*a != '\0' && *a++ == *b++) + len++; + + return len; +} + } /* namespace String */ namespace Validate { |