aboutsummaryrefslogtreecommitdiffstats
path: root/src/bootstrap/string_view.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-10-18 12:31:20 +0200
committerBad Diode <bd@badd10de.dev>2021-10-18 12:31:20 +0200
commit043a96a6b7cf55f7ef58fb5ebf8ad87b7d50b571 (patch)
tree14861de314cfa5587103bd3cf21a761dd0e8248e /src/bootstrap/string_view.h
parent6f34133b0661849bccf891ea0aa4d04f45ca9a9a (diff)
downloadbdl-043a96a6b7cf55f7ef58fb5ebf8ad87b7d50b571.tar.gz
bdl-043a96a6b7cf55f7ef58fb5ebf8ad87b7d50b571.zip
Add header files for all modules
Diffstat (limited to 'src/bootstrap/string_view.h')
-rw-r--r--src/bootstrap/string_view.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/bootstrap/string_view.h b/src/bootstrap/string_view.h
new file mode 100644
index 0000000..42273ab
--- /dev/null
+++ b/src/bootstrap/string_view.h
@@ -0,0 +1,21 @@
1#ifndef BDL_STRINGVIEW_H
2#define BDL_STRINGVIEW_H
3
4typedef struct StringView {
5 char *start;
6 size_t n;
7} StringView;
8
9// Consume a character in the stream.
10char sv_next(StringView *sv);
11
12// Check what is the current character in the stream.
13char sv_peek(const StringView *sv);
14
15// Compare if the arguments are the same.
16bool sv_equal(const StringView *a, const StringView *b);
17
18// Write a character to the given output stream.
19void sv_write(const StringView *sv, FILE *file);
20
21#endif // BDL_STRINGVIEW_H