aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
Diffstat (limited to 'manual')
-rwxr-xr-xmanual/2html2
-rw-r--r--manual/manual.of85
2 files changed, 56 insertions, 31 deletions
diff --git a/manual/2html b/manual/2html
index 43fd8913..bada6ee0 100755
--- a/manual/2html
+++ b/manual/2html
@@ -358,7 +358,7 @@ item = function (s)
358 local t, p = string.match(s, "^([^\n|]+)|()") 358 local t, p = string.match(s, "^([^\n|]+)|()")
359 if t then 359 if t then
360 s = string.sub(s, p) 360 s = string.sub(s, p)
361 s = Tag.b(t..": ") .. s 361 s = Tag.b(t) ..": " .. s
362 end 362 end
363 return Tag.li(fixpara(s)) 363 return Tag.li(fixpara(s))
364 end, 364 end,
diff --git a/manual/manual.of b/manual/manual.of
index cdd54f66..3181549d 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -664,7 +664,6 @@ Values equal to or less than 100 mean the collector will not wait to
664start a new cycle. 664start a new cycle.
665A value of 200 means that the collector waits for 665A value of 200 means that the collector waits for
666the total number of objects to double before starting a new cycle. 666the total number of objects to double before starting a new cycle.
667The default value is 200.
668 667
669The garbage-collector step size controls the 668The garbage-collector step size controls the
670size of each incremental step, 669size of each incremental step,
@@ -672,7 +671,6 @@ specifically how many objects the interpreter creates
672before performing a step: 671before performing a step:
673A value of @M{n} means the interpreter will create 672A value of @M{n} means the interpreter will create
674approximately @M{n} objects between steps. 673approximately @M{n} objects between steps.
675The default value is 250.
676 674
677The garbage-collector step multiplier 675The garbage-collector step multiplier
678controls the size of each GC step. 676controls the size of each GC step.
@@ -681,7 +679,6 @@ in each step, @M{n%} objects for each created object.
681Larger values make the collector more aggressive. 679Larger values make the collector more aggressive.
682Beware that values too small can 680Beware that values too small can
683make the collector too slow to ever finish a cycle. 681make the collector too slow to ever finish a cycle.
684The default value is 200.
685As a special case, a zero value means unlimited work, 682As a special case, a zero value means unlimited work,
686effectively producing a non-incremental, stop-the-world collector. 683effectively producing a non-incremental, stop-the-world collector.
687 684
@@ -711,7 +708,6 @@ after the last major collection.
711For instance, for a multiplier of 20, 708For instance, for a multiplier of 20,
712the collector will do a minor collection when the number of objects 709the collector will do a minor collection when the number of objects
713gets 20% larger than the total after the last major collection. 710gets 20% larger than the total after the last major collection.
714The default value is 25.
715 711
716The minor-major multiplier controls the shift to major collections. 712The minor-major multiplier controls the shift to major collections.
717For a multiplier @M{x}, 713For a multiplier @M{x},
@@ -721,7 +717,6 @@ than the total after the previous major collection.
721For instance, for a multiplier of 100, 717For instance, for a multiplier of 100,
722the collector will do a major collection when the number of old objects 718the collector will do a major collection when the number of old objects
723gets larger than twice the total after the previous major collection. 719gets larger than twice the total after the previous major collection.
724The default value is 100.
725 720
726The major-minor multiplier controls the shift back to minor collections. 721The major-minor multiplier controls the shift back to minor collections.
727For a multiplier @M{x}, 722For a multiplier @M{x},
@@ -731,7 +726,6 @@ of the objects allocated during the last cycle.
731In particular, for a multiplier of 0, 726In particular, for a multiplier of 0,
732the collector will immediately shift back to minor collections 727the collector will immediately shift back to minor collections
733after doing one cycle of major collections. 728after doing one cycle of major collections.
734The default value is 50.
735 729
736} 730}
737 731
@@ -5885,13 +5879,6 @@ or @id{NULL} if there is a @x{memory allocation error}.
5885 5879
5886} 5880}
5887 5881
5888@APIEntry{void luaL_openlibs (lua_State *L);|
5889@apii{0,0,e}
5890
5891Opens all standard Lua libraries into the given state.
5892
5893}
5894
5895@APIEntry{ 5882@APIEntry{
5896T luaL_opt (L, func, arg, dflt);| 5883T luaL_opt (L, func, arg, dflt);|
5897@apii{0,0,-} 5884@apii{0,0,-}
@@ -6073,7 +6060,7 @@ and sets the call result to @T{package.loaded[modname]},
6073as if that function has been called through @Lid{require}. 6060as if that function has been called through @Lid{require}.
6074 6061
6075If @id{glb} is true, 6062If @id{glb} is true,
6076also stores the module into the global @id{modname}. 6063also stores the module into the global variable @id{modname}.
6077 6064
6078Leaves a copy of the module on the stack. 6065Leaves a copy of the module on the stack.
6079 6066
@@ -6290,23 +6277,61 @@ Except for the basic and the package libraries,
6290each library provides all its functions as fields of a global table 6277each library provides all its functions as fields of a global table
6291or as methods of its objects. 6278or as methods of its objects.
6292 6279
6293To have access to these libraries, 6280}
6294the @N{C host} program should call the @Lid{luaL_openlibs} function, 6281
6295which opens all standard libraries. 6282
6283@sect2{lualib-h| @title{Loading the Libraries in C code}
6284
6285A @N{C host} program must explicitly load
6286the standard libraries into a state,
6287if it wants its scripts to use them.
6288For that,
6289the host program can call the function @Lid{luaL_openlibs}.
6296Alternatively, 6290Alternatively,
6297the host program can open them individually by using 6291the host can select which libraries to open,
6298@Lid{luaL_requiref} to call 6292by using @Lid{luaL_openselectedlibs}.
6299@defid{luaopen_base} (for the basic library), 6293Both functions are defined in the header file @id{lualib.h}.
6300@defid{luaopen_package} (for the package library), 6294@index{lualib.h}
6301@defid{luaopen_coroutine} (for the coroutine library), 6295
6302@defid{luaopen_string} (for the string library), 6296The stand-alone interpreter @id{lua} @see{lua-sa}
6303@defid{luaopen_utf8} (for the UTF-8 library), 6297already opens all standard libraries.
6304@defid{luaopen_table} (for the table library), 6298
6305@defid{luaopen_math} (for the mathematical library), 6299@APIEntry{void luaL_openlibs (lua_State *L);|
6306@defid{luaopen_io} (for the I/O library), 6300@apii{0,0,e}
6307@defid{luaopen_os} (for the operating system library), 6301
6308and @defid{luaopen_debug} (for the debug library). 6302Opens all standard Lua libraries into the given state.
6309These functions are declared in @defid{lualib.h}. 6303
6304}
6305
6306@APIEntry{void luaL_openselectedlibs (lua_State *L, int load, int preload);|
6307@apii{0,0,e}
6308
6309Opens (loads) and preloads selected libraries into the state @id{L}.
6310(To @emph{preload} means to add
6311the library loader into the table @Lid{package.preload},
6312so that the library can be required later by the program.
6313Keep in mind that @Lid{require} itself is provided
6314by the @emph{package} library.
6315If a program does not load that library,
6316it will be unable to require anything.)
6317
6318The integer @id{load} selects which libraries to load;
6319the integer @id{preload} selects which to preload, among those not loaded.
6320Both are masks formed by a bitwise OR of the following constants:
6321@description{
6322@item{@defid{LUA_GLIBK} | the basic library.}
6323@item{@defid{LUA_LOADLIBK} | the package library.}
6324@item{@defid{LUA_COLIBK} | the coroutine library.}
6325@item{@defid{LUA_STRLIBK} | the string library.}
6326@item{@defid{LUA_UTF8LIBK} | the UTF-8 library.}
6327@item{@defid{LUA_TABLIBK} | the table library.}
6328@item{@defid{LUA_MATHLIBK} | the mathematical library.}
6329@item{@defid{LUA_IOLIBK} | the I/O library.}
6330@item{@defid{LUA_OSLIBK} | the operating system library.}
6331@item{@defid{LUA_DBLIBK} | the debug library.}
6332}
6333
6334}
6310 6335
6311} 6336}
6312 6337