summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/luajit-3065c9/src/lj_str.h
diff options
context:
space:
mode:
Diffstat (limited to 'fluent-bit/lib/luajit-3065c9/src/lj_str.h')
-rw-r--r--fluent-bit/lib/luajit-3065c9/src/lj_str.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/fluent-bit/lib/luajit-3065c9/src/lj_str.h b/fluent-bit/lib/luajit-3065c9/src/lj_str.h
new file mode 100644
index 000000000..28edb5a5e
--- /dev/null
+++ b/fluent-bit/lib/luajit-3065c9/src/lj_str.h
@@ -0,0 +1,31 @@
+/*
+** String handling.
+** Copyright (C) 2005-2022 Mike Pall. See Copyright Notice in luajit.h
+*/
+
+#ifndef _LJ_STR_H
+#define _LJ_STR_H
+
+#include <stdarg.h>
+
+#include "lj_obj.h"
+
+/* String helpers. */
+LJ_FUNC int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b);
+LJ_FUNC const char *lj_str_find(const char *s, const char *f,
+ MSize slen, MSize flen);
+LJ_FUNC int lj_str_haspattern(GCstr *s);
+
+/* String interning. */
+LJ_FUNC void lj_str_resize(lua_State *L, MSize newmask);
+LJ_FUNCA GCstr *lj_str_new(lua_State *L, const char *str, size_t len);
+LJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s);
+LJ_FUNC void LJ_FASTCALL lj_str_init(lua_State *L);
+#define lj_str_freetab(g) \
+ (lj_mem_freevec(g, g->str.tab, g->str.mask+1, GCRef))
+
+#define lj_str_newz(L, s) (lj_str_new(L, s, strlen(s)))
+#define lj_str_newlit(L, s) (lj_str_new(L, "" s, sizeof(s)-1))
+#define lj_str_size(len) (sizeof(GCstr) + (((len)+4) & ~(MSize)3))
+
+#endif