summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2006-12-18 16:17:11 +0000
committerAkira TAGOH <akira@tagoh.org>2006-12-18 16:17:11 +0000
commit8df0660e62a86e4a5f98242d4c0fcd8a429f2d59 (patch)
tree4a1fb26af45dc8c2ea2c5677ad8e77cc8bbf144b
parentb1a4c2308bc530fe40b72bfbae93e75fed3b5f6d (diff)
* hieroglyph/hgstring.c (hg_string_erase): new function.
-rw-r--r--ChangeLog2
-rw-r--r--hieroglyph/hgstring.c19
-rw-r--r--hieroglyph/hgstring.h3
-rw-r--r--hieroglyph/version.h.in2
4 files changed, 25 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fd22e7a..6b7188c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2006-12-19 Akira TAGOH <at@gclab.org>
+ * hieroglyph/hgstring.c (hg_string_erase): new function.
+
* hieroglyph/scanner.c (_hg_scanner_parse_number): fix a parser to
recognize a special character after numeric.
diff --git a/hieroglyph/hgstring.c b/hieroglyph/hgstring.c
index c51aa3d..ef3ad02 100644
--- a/hieroglyph/hgstring.c
+++ b/hieroglyph/hgstring.c
@@ -327,6 +327,25 @@ hg_string_insert_c(HgString *string,
}
gboolean
+hg_string_erase(HgString *string,
+ guint pos,
+ guint length)
+{
+ guint i, j;
+
+ g_return_val_if_fail (string != NULL, FALSE);
+ g_return_val_if_fail (pos < string->length, FALSE);
+ g_return_val_if_fail ((pos + length) <= string->length, FALSE);
+
+ for (i = pos, j = (pos + length); j < string->length; i++, j++) {
+ string->current[j] = string->current[i];
+ }
+ string->length -= length;
+
+ return TRUE;
+}
+
+gboolean
hg_string_concat(HgString *string1,
HgString *string2)
{
diff --git a/hieroglyph/hgstring.h b/hieroglyph/hgstring.h
index 3b6fe09..4c9e058 100644
--- a/hieroglyph/hgstring.h
+++ b/hieroglyph/hgstring.h
@@ -52,6 +52,9 @@ gboolean hg_string_concat (HgString *string1,
HgString *string2);
gchar hg_string_index (HgString *string,
guint index);
+gboolean hg_string_erase (HgString *string,
+ guint pos,
+ guint length);
gchar *hg_string_get_string (HgString *string);
gboolean hg_string_fix_string_size (HgString *string);
gboolean hg_string_compare (const HgString *a,
diff --git a/hieroglyph/version.h.in b/hieroglyph/version.h.in
index f1b0b46..5185b87 100644
--- a/hieroglyph/version.h.in
+++ b/hieroglyph/version.h.in
@@ -29,7 +29,7 @@
G_BEGIN_DECLS
#define HIEROGLYPH_VERSION "@VERSION@"
-#define HIEROGLYPH_UUID "12085fa0-d557-4a8e-9b1d-a78a58e3de0f"
+#define HIEROGLYPH_UUID "c04d359e-666f-4cfe-b152-321fd7a288df"
const char *__hg_rcsid G_GNUC_UNUSED = "$Rev$";