From 91016bd3855375796fd1eabd501ebc12491f2655 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 11 Jan 2022 09:58:43 +0800 Subject: 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. --- src/str.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/str.c') 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; } -- cgit v1.2.3-18-g5258