summaryrefslogtreecommitdiff
path: root/src/str.c
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-01-11 09:58:43 +0800
committerJSDurand <mmemmew@gmail.com>2022-01-11 09:58:43 +0800
commit91016bd3855375796fd1eabd501ebc12491f2655 (patch)
treec4a608966b686c9639a90b92c31c00632532fac8 /src/str.c
parent949888ad5d0cd0f9f9a87f9938a632b3e32df051 (diff)
Add the framework for character classes.
Now we have the potential to recognize character classes. But the most important task for us now is to experiment with ((B)RN)GLR algorithms, so we leave the character classes at the present state for a moment.
Diffstat (limited to 'src/str.c')
-rw-r--r--src/str.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/str.c b/src/str.c
index 46dc4a8..fdff99a 100644
--- a/src/str.c
+++ b/src/str.c
@@ -4,7 +4,7 @@
H_ATTR
str_info
-_info_getter(str *s, UNUM n)
+_info_getter(const str * const restrict s, UNUM n)
{
return (str_info) { (NUM) *(s->data+n), 1 };
}
@@ -41,14 +41,14 @@ destroy_str(str *s, int flag)
H_ATTR
str_info
-get_info(str *s, UNUM n)
+get_info(const str * const restrict s, UNUM n)
{
return s->getter(s, n);
}
H_ATTR
NUM
-str_length(str *s)
+str_length(const str * const restrict s)
{
return s->size;
}
@@ -60,7 +60,7 @@ change_str_content(str *s, char *str, NUM size)
s->size = size;
}
-unsigned char
+BOOL
copy_str(str *dest, str *source)
{
if (str_length(dest) < str_length(source))
@@ -74,7 +74,7 @@ copy_str(str *dest, str *source)
}
char *
-get_data(str *s)
+get_data(const str * const restrict s)
{
return s->data;
}