aboutsummaryrefslogtreecommitdiff
path: root/lstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'lstring.h')
-rw-r--r--lstring.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/lstring.h b/lstring.h
index 450c2390..069e64b7 100644
--- a/lstring.h
+++ b/lstring.h
@@ -20,10 +20,18 @@
20 20
21 21
22/* 22/*
23** Size of a TString: Size of the header plus space for the string 23** Size of a short TString: Size of the header plus space for the string
24** itself (including final '\0'). 24** itself (including final '\0').
25*/ 25*/
26#define sizelstring(l) (offsetof(TString, contents) + ((l) + 1) * sizeof(char)) 26#define sizestrshr(l) \
27 (offsetof(TString, contents) + ((l) + 1) * sizeof(char))
28
29/*
30** Size of a long TString: Size of the header plus space for the string
31** itself (including final '\0').
32*/
33#define sizestrlng(l) (sizeof(TString) + ((l) + 1) * sizeof(char))
34
27 35
28#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 36#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
29 (sizeof(s)/sizeof(char))-1)) 37 (sizeof(s)/sizeof(char))-1))