summaryrefslogtreecommitdiffstats
path: root/byterun/str.c
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/str.c')
-rw-r--r--byterun/str.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/byterun/str.c b/byterun/str.c
index 5e1ad99b8..a97a8d787 100644
--- a/byterun/str.c
+++ b/byterun/str.c
@@ -49,6 +49,24 @@ value string_set(str, index, newval) /* ML */
return Val_unit;
}
+value string_equal(s1, s2) /* ML */
+ value s1, s2;
+{
+ mlsize_t sz1 = Wosize_val(s1);
+ mlsize_t sz2 = Wosize_val(s2);
+ value * p1, * p2;
+ if (sz1 != sz2) return Val_false;
+ for(p1 = Op_val(s1), p2 = Op_val(s2); sz1 > 0; sz1--, p1++, p2++)
+ if (*p1 != *p2) return Val_false;
+ return Val_true;
+}
+
+value string_notequal(s1, s2) /* ML */
+ value s1, s2;
+{
+ return Val_not(string_equal(s1, s2));
+}
+
value blit_string(argv, argc) /* ML */
value * argv;
int argc;