lstring.h 868 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. ** $Id: lstring.h,v 1.37 2002/08/16 14:45:55 roberto Exp roberto $
  3. ** String table (keep all strings handled by Lua)
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef lstring_h
  7. #define lstring_h
  8. #include "lgc.h"
  9. #include "lobject.h"
  10. #include "lstate.h"
  11. #define sizestring(l) (cast(lu_mem, sizeof(union TString))+ \
  12. (cast(lu_mem, l)+1)*sizeof(char))
  13. #define sizeudata(l) (cast(lu_mem, sizeof(union Udata))+(l))
  14. #define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
  15. #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
  16. (sizeof(s)/sizeof(char))-1))
  17. #define luaS_fix(s) setbit((s)->tsv.marked, FIXEDBIT)
  18. void luaS_resize (lua_State *L, int newsize);
  19. Udata *luaS_newudata (lua_State *L, size_t s);
  20. void luaS_freeall (lua_State *L);
  21. TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
  22. #endif