package ocaml-lua

  1. Overview
  2. Docs

Module Lua_aux_libSource

The Lua Auxiliary Library (OCaml binding)

Difference with the original Lua Auxiliary Library

Here is a list of functions of which you should read documentation:

Types definitions

Sourcetype buffer

See luaL_Buffer documentation.

See luaL_reg documentation.

Constant values

Sourceval refnil : int

Value returned by `luaL_ref` and `luaL_unref`. See luaL_ref and luaL_unref documentation.

Sourceval noref : int

Value returned by `luaL_ref` and `luaL_unref`. See luaL_ref and luaL_unref documentation.

The Auxiliary Library functions

Sourceval addchar : buffer -> char -> unit

See luaL_addchar documentation.

NOTE: this function is not a binding of the original luaL_addchar, it's rather an OCaml function with the same semantics.

Sourceval addlstring : buffer -> string -> unit

See luaL_addlstring documentation.

NOTE: this function is not a binding of the original luaL_addlstring, it's rather an OCaml function with the same semantics.

The function luaL_addsize is not present because the type Lua_aux_lib.buffer and related functions have been reimplemented in OCaml, and luaL_addsize is not needed.

Sourceval addstring : buffer -> string -> unit

See luaL_addstring documentation.

NOTE: this function is an alias of Lua_aux_lib.addlstring

Sourceval addvalue : buffer -> unit

See luaL_addvalue documentation.

NOTE: this function is not a binding of the original luaL_addvalue, it's rather an OCaml function with the same semantics.

Sourceval argcheck : Lua_api_lib.state -> bool -> int -> string -> unit

See luaL_argcheck documentation.

Sourceval argerror : Lua_api_lib.state -> int -> string -> 'a

See luaL_argerror documentation.

See luaL_buffinit documentation.

Sourceval callmeta : Lua_api_lib.state -> int -> string -> bool

See luaL_callmeta documentation.

Sourceval checkany : Lua_api_lib.state -> int -> unit

See luaL_checkany documentation.

Sourceval checkint : Lua_api_lib.state -> int -> int

See luaL_checkint documentation.

Sourceval checkinteger : Lua_api_lib.state -> int -> int

See luaL_checkinteger documentation.

NOTE: this function is an alias of Lua_aux_lib.checkint

Sourceval checklong : Lua_api_lib.state -> int -> int

See luaL_checklong documentation.

Sourceval checklstring : Lua_api_lib.state -> int -> string

See luaL_checklstring documentation.

NOTE:The original len argument is missing because, unlike in C, there is no impedance mismatch between OCaml and Lua strings.

NOTE: this function is not a binding of the original luaL_checklstring, it's rather an OCaml function with the same semantics.

Sourceval checkstring : Lua_api_lib.state -> int -> string

See luaL_checkstring documentation.

NOTE: this function is an alias of Lua_aux_lib.checklstring

Sourceval checknumber : Lua_api_lib.state -> int -> float

See luaL_checknumber documentation.

NOTE: this function is not a binding of the original luaL_checknumber, it's rather an OCaml function with the same semantics.

Sourceval checkoption : Lua_api_lib.state -> int -> string option -> string list -> int

See luaL_checkoption documentation.

NOTE: this function is not a binding of the original luaL_checkoption, it's rather an OCaml function with the same semantics.

Sourceval checkstack : Lua_api_lib.state -> int -> string -> unit

See luaL_checkstack documentation.

NOTE: this function is not a binding of the original luaL_checkstack, it's rather an OCaml function with the same semantics.

Sourceval checktype : Lua_api_lib.state -> int -> Lua_api_lib.lua_type -> unit

See luaL_checktype documentation.

NOTE: this function is not a binding of the original luaL_checktype, it's rather an OCaml function with the same semantics.

Sourceval checkudata : Lua_api_lib.state -> int -> string -> [> `Userdata of 'a | `Light_userdata of 'a ] option

See luaL_checkudata documentation.

NOTE: this function is not a binding of the original luaL_checkudata, it's rather an OCaml function with the same semantics.

Sourceval dofile : Lua_api_lib.state -> string -> bool

See luaL_dofile documentation.

NOTE: this function is not a binding of the original luaL_dofile, it's rather an OCaml function with the same semantics.

Sourceval dostring : Lua_api_lib.state -> string -> bool

See luaL_dostring documentation.

NOTE: this function is not a binding of the original luaL_dostring, it's rather an OCaml function with the same semantics.

Sourceval error : Lua_api_lib.state -> ('a, unit, string, 'b) format4 -> 'a

See luaL_error documentation.

NOTE: this function is not a binding of the original luaL_error, it's rather an OCaml function with the same semantics.

Warning: this function has a different behavior with respect to the original luaL_error because the conversion specifiers are not restricted as specified in the Lua documentation, but you can use all the conversions of the Printf module.

Sourceval getmetafield : Lua_api_lib.state -> int -> string -> bool

See luaL_getmetafield documentation.

Sourceval getmetatable : Lua_api_lib.state -> string -> unit

See luaL_getmetatable documentation.

Sourceval gsub : Lua_api_lib.state -> string -> string -> string -> string

See luaL_gsub documentation.

Sourceval loadbuffer : Lua_api_lib.state -> string -> string -> Lua_api_lib.thread_status

See luaL_loadbuffer documentation.

See luaL_loadfile documentation.

See luaL_loadstring documentation.

Sourceval newmetatable : Lua_api_lib.state -> string -> bool

See luaL_newmetatable documentation.

Sourceval newstate : ?max_memory_size:int -> unit -> Lua_api_lib.state

See luaL_newstate documentation.

NOTE: this function is not a binding of the original luaL_newstate, it's rather an OCaml function with the same semantics.

An optional parameter, not available in the original luaL_newstate, provide the user the chance to specify the maximum memory (in byte) that Lua is allowed to allocate for this state.

Sourceval openlibs : Lua_api_lib.state -> unit

See luaL_openlibs documentation.

Sourceval optint : Lua_api_lib.state -> int -> int -> int

See luaL_optint documentation.

NOTE: this function is an alias of Lua_aux_lib.optinteger

Sourceval optinteger : Lua_api_lib.state -> int -> int -> int

See luaL_optinteger documentation.

Sourceval optlong : Lua_api_lib.state -> int -> int -> int

See luaL_optlong documentation.

Sourceval optlstring : Lua_api_lib.state -> int -> string -> string

See luaL_optlstring documentation.

NOTE: this function is not a binding of the original luaL_optlstring, it's rather an OCaml function with the same semantics.

Sourceval optnumber : Lua_api_lib.state -> int -> float -> float

See luaL_optnumber documentation.

NOTE: this function is not a binding of the original luaL_optnumber, it's rather an OCaml function with the same semantics.

Sourceval optstring : Lua_api_lib.state -> int -> string -> string

See luaL_optstring documentation.

NOTE: this function is an alias of Lua_aux_lib.optlstring

The function luaL_prepbuffer is not present because the type Lua_aux_lib.buffer and related functions have been reimplemented in OCaml, and luaL_prepbuffer is not needed.

Sourceval pushresult : buffer -> unit

See luaL_pushresult documentation.

NOTE: this function is not a binding of the original luaL_pushresult, it's rather an OCaml function with the same semantics.

Sourceval ref_ : Lua_api_lib.state -> int -> int

See luaL_ref documentation.

Sourceval register : Lua_api_lib.state -> string option -> reg list -> unit

See luaL_register documentation.

NOTE: this function is not a binding of the original luaL_register, it's rather an OCaml function with the same semantics.

Sourceval typename : Lua_api_lib.state -> int -> string

See luaL_typename documentation.

NOTE: this function is not a binding of the original luaL_typename, it's rather an OCaml function with the same semantics.

Sourceval typerror : Lua_api_lib.state -> int -> string -> 'a

See luaL_typerror documentation.

Sourceval unref : Lua_api_lib.state -> int -> int -> unit

See luaL_unref documentation.

Sourceval where : Lua_api_lib.state -> int -> unit

See luaL_where documentation.

OCaml

Innovation. Community. Security.