aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common.c
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-08-23 17:41:23 +0900
committernsfisis <nsfisis@gmail.com>2025-08-23 17:41:23 +0900
commit8646e6f693fd935c6cb81e776a6c92a3fd093a33 (patch)
tree450b60115282243bf0567b495e9e85f0d56abba1 /src/common.c
parentd83647f390d2910547ada2854eee6189e8552cb8 (diff)
downloadducc-8646e6f693fd935c6cb81e776a6c92a3fd093a33.tar.gz
ducc-8646e6f693fd935c6cb81e776a6c92a3fd093a33.tar.zst
ducc-8646e6f693fd935c6cb81e776a6c92a3fd093a33.zip
feat: output executable using gcc
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c
index 3553419..4e747bb 100644
--- a/src/common.c
+++ b/src/common.c
@@ -11,6 +11,14 @@ void fatal_error(const char* msg, ...) {
#define unimplemented() fatal_error("%s:%d: unimplemented", __FILE__, __LINE__)
+BOOL str_ends_with(const char* s, const char* suffix) {
+ size_t l1 = strlen(s);
+ size_t l2 = strlen(suffix);
+ if (l1 < l2)
+ return FALSE;
+ return strcmp(s + l1 - l2, suffix) == 0;
+}
+
struct StrBuilder {
size_t len;
size_t capacity;