lrotable.h 645 B

12345678910111213141516171819202122232425262728293031
  1. // Read-only tables for Lua
  2. #ifndef lrotable_h
  3. #define lrotable_h
  4. #include "lua.h"
  5. #include "llimits.h"
  6. #include "lauxlib.h"
  7. typedef lua_Number luaR_result;
  8. // A number entry in the read only table
  9. typedef struct
  10. {
  11. const char *name;
  12. lua_Number value;
  13. } luaR_value_entry;
  14. // A mapping between table name and its entries
  15. typedef struct
  16. {
  17. const char *name;
  18. const luaL_reg *pfuncs;
  19. const luaR_value_entry *pvalues;
  20. } luaR_table;
  21. luaR_result luaR_findglobal(const char *key, lu_byte *ptype);
  22. int luaR_findfunction(lua_State *L, const luaL_reg *ptable);
  23. luaR_result luaR_findentry(void *data, const char *key, lu_byte *ptype);
  24. #endif