CHDK_DE Vorschauversion  Trunk Rev. 6014
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
lualib.h-Dateireferenz
#include "lua.h"
+ Include-Abhängigkeitsdiagramm für lualib.h:
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define LUA_FILEHANDLE   "FILE*"
 
#define LUA_COLIBNAME   "coroutine"
 
#define LUA_TABLIBNAME   "table"
 
#define LUA_IOLIBNAME   "io"
 
#define LUA_OSLIBNAME   "os"
 
#define LUA_STRLIBNAME   "string"
 
#define LUA_MATHLIBNAME   "math"
 
#define LUA_IMATHLIBNAME   "imath"
 
#define LUA_FMATHLIBNAME   "fmath"
 
#define LUA_DBLIBNAME   "debug"
 
#define LUA_LOADLIBNAME   "package"
 
#define lua_assert(x)   ((void)0)
 

Funktionen

LUALIB_API int() luaopen_base (lua_State *L)
 
LUALIB_API int() luaopen_table (lua_State *L)
 
LUALIB_API int() luaopen_io (lua_State *L)
 
LUALIB_API int() luaopen_os (lua_State *L)
 
LUALIB_API int() luaopen_string (lua_State *L)
 
LUALIB_API int() luaopen_math (lua_State *L)
 
LUALIB_API int() luaopen_imath (lua_State *L)
 
LUALIB_API int() luaopen_fmath (lua_State *L)
 
LUALIB_API int() luaopen_debug (lua_State *L)
 
LUALIB_API int() luaopen_package (lua_State *L)
 
LUALIB_API void() luaL_openlibs (lua_State *L)
 

Makro-Dokumentation

#define lua_assert (   x)    ((void)0)

Definiert in Zeile 55 der Datei lualib.h.

#define LUA_COLIBNAME   "coroutine"

Definiert in Zeile 18 der Datei lualib.h.

#define LUA_DBLIBNAME   "debug"

Definiert in Zeile 42 der Datei lualib.h.

#define LUA_FILEHANDLE   "FILE*"

Definiert in Zeile 15 der Datei lualib.h.

#define LUA_FMATHLIBNAME   "fmath"

Definiert in Zeile 39 der Datei lualib.h.

#define LUA_IMATHLIBNAME   "imath"

Definiert in Zeile 36 der Datei lualib.h.

#define LUA_IOLIBNAME   "io"

Definiert in Zeile 24 der Datei lualib.h.

#define LUA_LOADLIBNAME   "package"

Definiert in Zeile 45 der Datei lualib.h.

#define LUA_MATHLIBNAME   "math"

Definiert in Zeile 33 der Datei lualib.h.

#define LUA_OSLIBNAME   "os"

Definiert in Zeile 27 der Datei lualib.h.

#define LUA_STRLIBNAME   "string"

Definiert in Zeile 30 der Datei lualib.h.

#define LUA_TABLIBNAME   "table"

Definiert in Zeile 21 der Datei lualib.h.

Dokumentation der Funktionen

LUALIB_API void() luaL_openlibs ( lua_State L)

Definiert in Zeile 32 der Datei linit.c.

32  {
33  const luaL_Reg *lib = lualibs;
34  for (; lib->func; lib++) {
35  lua_pushcfunction(L, lib->func);
36  lua_pushstring(L, lib->name);
37  lua_call(L, 1, 0);
38  }
39 }
LUALIB_API int() luaopen_base ( lua_State L)

Definiert in Zeile 685 der Datei lbaselib.c.

685  {
686  base_open(L);
687 // CHDK - disable coroutine lib
688 #ifdef HOST_LUA
689  luaL_register(L, LUA_COLIBNAME, co_funcs);
690 #endif
691  return 2;
692 }
LUALIB_API int() luaopen_debug ( lua_State L)

Definiert in Zeile 394 der Datei ldblib.c.

394  {
396  return 1;
397 }
LUALIB_API int() luaopen_fmath ( lua_State L)

Definiert in Zeile 530 der Datei lfmathlib.c.

530  {
531  luaL_newmetatable(L, "fmathmeta");
532  lua_pushstring(L, "__index");
533  lua_pushvalue(L, -2); /* pushes the metatable */
534  lua_settable(L, -3); /* metatable.__index = metatable */
536 
537  luaL_register(L, LUA_FMATHLIBNAME, &fmathlib_m[7]); // adjust offset if table is changed
538 
539  newval(L, M_PI * 2.0);
540  lua_setfield(L, -2, "pi2");
541  newval(L, M_PI);
542  lua_setfield(L, -2, "pi");
543  newval(L, M_PI / 2.0);
544  lua_setfield(L, -2, "pi_2");
545 
546  return 1;
547 }
LUALIB_API int() luaopen_imath ( lua_State L)

Definiert in Zeile 250 der Datei limathlib.c.

250  {
252 
254  lua_setfield(L, -2, "scale");
256  lua_setfield(L, -2, "pi2");
258  lua_setfield(L, -2, "pi");
260  lua_setfield(L, -2, "pi_2");
261 
262  return 1;
263 }
LUALIB_API int() luaopen_io ( lua_State L)

Definiert in Zeile 622 der Datei liolib.c.

622  {
623  createmeta(L);
624  /* create (private) environment (with fields IO_INPUT, IO_OUTPUT, __close) */
625  newfenv(L, io_fclose);
627  /* open library */
629  /* create (and set) default files */
630  newfenv(L, io_noclose); /* close function for default files */
631 #ifdef HOST_LUA
632  createstdfile(L, stdin, IO_INPUT, "stdin");
633  createstdfile(L, stdout, IO_OUTPUT, "stdout");
634  createstdfile(L, stderr, 0, "stderr");
635 #else
636 // initialize them in the closed state
637 // stderr/stdout could go to regular files or script console
638  createstdfile(L, NULL, IO_INPUT, "stdin");
639  createstdfile(L, NULL, IO_OUTPUT, "stdout");
640  createstdfile(L, NULL, 0, "stderr");
641 #endif
642  lua_pop(L, 1); /* pop environment for default files */
643  // reyalp - no popen
644 #if 0
645  lua_getfield(L, -1, "popen");
646  newfenv(L, io_pclose); /* create environment for 'popen' */
647  lua_setfenv(L, -2); /* set fenv for 'popen' */
648  lua_pop(L, 1); /* pop 'popen' */
649 #endif
650  return 1;
651 }
LUALIB_API int() luaopen_math ( lua_State L)

Definiert in Zeile 272 der Datei lmathlib.c.

272  {
274 #if 0
275  lua_pushnumber(L, PI);
276  lua_setfield(L, -2, "pi");
277  lua_pushnumber(L, HUGE_VAL);
278  lua_setfield(L, -2, "huge");
279 #endif
280 #if defined(LUA_COMPAT_MOD)
281  lua_getfield(L, -1, "fmod");
282  lua_setfield(L, -2, "mod");
283 #endif
284  return 1;
285 }
LUALIB_API int() luaopen_os ( lua_State L)

Definiert in Zeile 545 der Datei loslib.c.

545  {
546  idir_register(L);
548  return 1;
549 }
LUALIB_API int() luaopen_package ( lua_State L)

Definiert in Zeile 637 der Datei loadlib.c.

637  {
638  int i;
639 #if 0
640  /* create new type _LOADLIB */
641  luaL_newmetatable(L, "_LOADLIB");
642  lua_pushcfunction(L, gctm);
643  lua_setfield(L, -2, "__gc");
644 #endif
645  /* create `package' table */
647 #if 0
648 #if defined(LUA_COMPAT_LOADLIB)
649  lua_getfield(L, -1, "loadlib");
650  lua_setfield(L, LUA_GLOBALSINDEX, "loadlib");
651 #endif
652 #endif
653  lua_pushvalue(L, -1);
655  /* create `loaders' table */
656  lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0);
657  /* fill it with pre-defined loaders */
658  for (i=0; loaders[i] != NULL; i++) {
659  lua_pushcfunction(L, loaders[i]);
660  lua_rawseti(L, -2, i+1);
661  }
662  lua_setfield(L, -2, "loaders"); /* put it in field `loaders' */
663  setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT); /* set field `path' */
664  setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */
665  /* store config information */
667  LUA_EXECDIR "\n" LUA_IGMARK);
668  lua_setfield(L, -2, "config");
669  /* set field `loaded' */
670  luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 2);
671  lua_setfield(L, -2, "loaded");
672  /* set field `preload' */
673  lua_newtable(L);
674  lua_setfield(L, -2, "preload");
676  luaL_register(L, NULL, ll_funcs); /* open lib into global table */
677  lua_pop(L, 1);
678  return 1; /* return 'package' table */
679 }
LUALIB_API int() luaopen_string ( lua_State L)

Definiert in Zeile 862 der Datei lstrlib.c.

862  {
864 #if defined(LUA_COMPAT_GFIND)
865  lua_getfield(L, -1, "gmatch");
866  lua_setfield(L, -2, "gfind");
867 #endif
868  createmetatable(L);
869  return 1;
870 }
LUALIB_API int() luaopen_table ( lua_State L)

Definiert in Zeile 283 der Datei ltablib.c.

283  {
285  return 1;
286 }