1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add capability to read table flag fields from Lua API

This commit is contained in:
kwolekr 2014-02-09 12:38:50 -05:00
parent 57710520dc
commit 2a01050a0c
7 changed files with 83 additions and 3 deletions

View file

@ -163,6 +163,19 @@ std::string writeFlagString(u32 flags, FlagDesc *flagdesc, u32 flagmask)
return result;
}
size_t mystrlcpy(char *dst, const char *src, size_t size)
{
size_t srclen = strlen(src) + 1;
size_t copylen = MYMIN(srclen, size);
if (copylen > 0) {
memcpy(dst, src, copylen);
dst[copylen - 1] = '\0';
}
return srclen;
}
char *mystrtok_r(char *s, const char *sep, char **lasts)
{
char *t;