summary refs log tree commit diff stats
path: root/lib/newwrap/lua
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2010-02-28 23:04:18 +0100
committerAndreas Rumpf <rumpf_a@web.de>2010-02-28 23:04:18 +0100
commitb559285b78bfa76533d25e77f3f61cab2427bb03 (patch)
treef418f489f307f825a934cea878921f65c0114561 /lib/newwrap/lua
parentddb718548278290a1c25c1bbfba82bc5581457a7 (diff)
downloadNim-b559285b78bfa76533d25e77f3f61cab2427bb03.tar.gz
examples/lib use the new wrappers
Diffstat (limited to 'lib/newwrap/lua')
-rwxr-xr-xlib/newwrap/lua/lauxlib.nim225
-rwxr-xr-xlib/newwrap/lua/lua.nim399
-rwxr-xr-xlib/newwrap/lua/lualib.nim66
3 files changed, 0 insertions, 690 deletions
diff --git a/lib/newwrap/lua/lauxlib.nim b/lib/newwrap/lua/lauxlib.nim
deleted file mode 100755
index bcb806f74..000000000
--- a/lib/newwrap/lua/lauxlib.nim
+++ /dev/null
@@ -1,225 +0,0 @@
-#*****************************************************************************
-# *                                                                            *
-# *  File:        lauxlib.pas                                                  *
-# *  Authors:     TeCGraf           (C headers + actual Lua libraries)         *
-# *               Lavergne Thomas   (original translation to Pascal)           *
-# *               Bram Kuijvenhoven (update to Lua 5.1.1 for FreePascal)       *
-# *  Description: Lua auxiliary library                                        *
-# *                                                                            *
-# *****************************************************************************
-#
-#** $Id: lauxlib.h,v 1.59 2003/03/18 12:25:32 roberto Exp $
-#** Auxiliary functions for building Lua libraries
-#** See Copyright Notice in lua.h
-#
-#
-#** Translated to pascal by Lavergne Thomas
-#** Notes :
-#**    - Pointers type was prefixed with 'P'
-#** Bug reports :
-#**    - thomas.lavergne@laposte.net
-#**   In french or in english
-#
-
-import 
-  lua
-
-proc pushstring*(L: PState, s: string)
-  # compatibilty macros
-proc getn*(L: PState, n: int): int
-  # calls lua_objlen
-proc setn*(L: PState, t, n: int)
-  # does nothing!
-type 
-  Treg*{.final.} = object 
-    name*: cstring
-    func*: CFunction
-
-  Preg* = ptr Treg
-
-proc openlib*(L: PState, libname: cstring, lr: Preg, nup: int){.cdecl, 
-    dynlib: lua.LIB_NAME, importc: "luaL_openlib".}
-proc register*(L: PState, libname: cstring, lr: Preg){.cdecl, 
-    dynlib: lua.LIB_NAME, importc: "luaL_register".}
-proc getmetafield*(L: PState, obj: int, e: cstring): int{.cdecl, 
-    dynlib: lua.LIB_NAME, importc: "luaL_getmetafield".}
-proc callmeta*(L: PState, obj: int, e: cstring): int{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_callmeta".}
-proc typerror*(L: PState, narg: int, tname: cstring): int{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_typerror".}
-proc argerror*(L: PState, numarg: int, extramsg: cstring): int{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_argerror".}
-proc checklstring*(L: PState, numArg: int, len: ptr int): cstring{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_checklstring".}
-proc optlstring*(L: PState, numArg: int, def: cstring, len: ptr int): cstring{.
-    cdecl, dynlib: LIB_NAME, importc: "luaL_optlstring".}
-proc checknumber*(L: PState, numArg: int): Number{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_checknumber".}
-proc optnumber*(L: PState, nArg: int, def: Number): Number{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_optnumber".}
-proc checkinteger*(L: PState, numArg: int): Integer{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_checkinteger".}
-proc optinteger*(L: PState, nArg: int, def: Integer): Integer{.
-    cdecl, dynlib: LIB_NAME, importc: "luaL_optinteger".}
-proc checkstack*(L: PState, sz: int, msg: cstring){.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_checkstack".}
-proc checktype*(L: PState, narg, t: int){.cdecl, dynlib: LIB_NAME, 
-    importc: "luaL_checktype".}
-proc checkany*(L: PState, narg: int){.cdecl, dynlib: LIB_NAME, 
-    importc: "luaL_checkany".}
-proc newmetatable*(L: PState, tname: cstring): int{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_newmetatable".}
-proc checkudata*(L: PState, ud: int, tname: cstring): Pointer{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_checkudata".}
-proc where*(L: PState, lvl: int){.cdecl, dynlib: LIB_NAME, 
-                                      importc: "luaL_where".}
-proc error*(L: PState, fmt: cstring): int{.cdecl, varargs, 
-    dynlib: LIB_NAME, importc: "luaL_error".}
-proc checkoption*(L: PState, narg: int, def: cstring, lst: cstringArray): int{.
-    cdecl, dynlib: LIB_NAME, importc: "luaL_checkoption".}
-proc reference*(L: PState, t: int): int{.cdecl, dynlib: LIB_NAME, 
-                                       importc: "luaL_ref".}
-proc unref*(L: PState, t, theref: int){.cdecl, dynlib: LIB_NAME, 
-    importc: "luaL_unref".}
-proc loadfile*(L: PState, filename: cstring): int{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_loadfile".}
-proc loadbuffer*(L: PState, buff: cstring, size: int, name: cstring): int{.
-    cdecl, dynlib: LIB_NAME, importc: "luaL_loadbuffer".}
-proc loadstring*(L: PState, s: cstring): int{.cdecl, dynlib: LIB_NAME, 
-    importc: "luaL_loadstring".}
-proc newstate*(): PState{.cdecl, dynlib: LIB_NAME, 
-                              importc: "luaL_newstate".}
-proc open*(): PState
-  # compatibility; moved from unit lua to lauxlib because it needs luaL_newstate
-  #
-  #** ===============================================================
-  #** some useful macros
-  #** ===============================================================
-  #
-proc argcheck*(L: PState, cond: bool, numarg: int, extramsg: cstring)
-proc checkstring*(L: PState, n: int): cstring
-proc optstring*(L: PState, n: int, d: cstring): cstring
-proc checkint*(L: PState, n: int): int
-proc checklong*(L: PState, n: int): int32
-proc optint*(L: PState, n: int, d: float64): int
-proc optlong*(L: PState, n: int, d: float64): int32
-proc dofile*(L: PState, filename: cstring): int
-proc dostring*(L: PState, str: cstring): int
-proc getmetatable*(L: PState, tname: cstring)
-  # not translated:
-  # #define luaL_opt(L,f,n,d)	(lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
-  #
-  #** =======================================================
-  #** Generic Buffer manipulation
-  #** =======================================================
-  #
-const                         # note: this is just arbitrary, as it related to the BUFSIZ defined in stdio.h ...
-  BUFFERSIZE* = 4096
-
-type 
-  Buffer*{.final.} = object 
-    p*: cstring               # current position in buffer 
-    lvl*: int                 # number of strings in the stack (level) 
-    L*: PState
-    buffer*: array[0..BUFFERSIZE - 1, Char] # warning: see note above about LUAL_BUFFERSIZE
-  
-  PBuffer* = ptr Buffer
-
-proc addchar*(B: PBuffer, c: Char)
-  # warning: see note above about LUAL_BUFFERSIZE
-  # compatibility only (alias for luaL_addchar) 
-proc putchar*(B: PBuffer, c: Char)
-  # warning: see note above about LUAL_BUFFERSIZE
-proc addsize*(B: PBuffer, n: int)
-proc buffinit*(L: PState, B: PBuffer){.cdecl, dynlib: LIB_NAME, 
-    importc: "luaL_buffinit".}
-proc prepbuffer*(B: PBuffer): cstring{.cdecl, dynlib: LIB_NAME, 
-                                       importc: "luaL_prepbuffer".}
-proc addlstring*(B: PBuffer, s: cstring, L: int){.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_addlstring".}
-proc addstring*(B: PBuffer, s: cstring){.cdecl, dynlib: LIB_NAME, 
-    importc: "luaL_addstring".}
-proc addvalue*(B: PBuffer){.cdecl, dynlib: LIB_NAME, 
-                            importc: "luaL_addvalue".}
-proc pushresult*(B: PBuffer){.cdecl, dynlib: LIB_NAME, 
-                              importc: "luaL_pushresult".}
-proc gsub*(L: PState, s, p, r: cstring): cstring{.cdecl, 
-    dynlib: LIB_NAME, importc: "luaL_gsub".}
-proc findtable*(L: PState, idx: int, fname: cstring, szhint: int): cstring{.
-    cdecl, dynlib: LIB_NAME, importc: "luaL_findtable".}
-  # compatibility with ref system 
-  # pre-defined references 
-const 
-  NOREF* = - 2
-  REFNIL* = - 1
-
-proc unref*(L: PState, theref: int)
-proc getref*(L: PState, theref: int)
-  #
-  #** Compatibility macros and functions
-  #
-# implementation
-
-proc pushstring(L: PState, s: string) = 
-  pushlstring(L, cstring(s), len(s))
-
-proc getn(L: PState, n: int): int = 
-  Result = objlen(L, n)
-
-proc setn(L: PState, t, n: int) = 
-  # does nothing as this operation is deprecated
-  nil
-
-proc open(): PState = 
-  Result = newstate()
-
-proc dofile(L: PState, filename: cstring): int = 
-  Result = loadfile(L, filename)
-  if Result == 0: Result = pcall(L, 0, MULTRET, 0)
-  
-proc dostring(L: PState, str: cstring): int = 
-  Result = loadstring(L, str)
-  if Result == 0: Result = pcall(L, 0, MULTRET, 0)
-  
-proc getmetatable(L: PState, tname: cstring) = 
-  getfield(L, REGISTRYINDEX, tname)
-
-proc argcheck(L: PState, cond: bool, numarg: int, extramsg: cstring) = 
-  if not cond: 
-    discard argerror(L, numarg, extramsg)
-
-proc checkstring(L: PState, n: int): cstring = 
-  Result = checklstring(L, n, nil)
-
-proc optstring(L: PState, n: int, d: cstring): cstring = 
-  Result = optlstring(L, n, d, nil)
-
-proc checkint(L: PState, n: int): int = 
-  Result = toInt(checknumber(L, n))
-
-proc checklong(L: PState, n: int): int32 = 
-  Result = int32(ToInt(checknumber(L, n)))
-
-proc optint(L: PState, n: int, d: float64): int = 
-  Result = int(ToInt(optnumber(L, n, d)))
-
-proc optlong(L: PState, n: int, d: float64): int32 = 
-  Result = int32(ToInt(optnumber(L, n, d)))
-
-proc addchar(B: PBuffer, c: Char) = 
-  if cast[int](addr((B.p))) < (cast[int](addr((B.buffer[0]))) + BUFFERSIZE): 
-    discard prepbuffer(B)
-  B.p[1] = c
-  B.p = cast[cstring](cast[int](B.p) + 1)
-
-proc putchar(B: PBuffer, c: Char) = 
-  addchar(B, c)
-
-proc addsize(B: PBuffer, n: int) = 
-  B.p = cast[cstring](cast[int](B.p) + n)
-
-proc unref(L: PState, theref: int) = 
-  unref(L, REGISTRYINDEX, theref)
-
-proc getref(L: PState, theref: int) = 
-  rawgeti(L, REGISTRYINDEX, theref)
diff --git a/lib/newwrap/lua/lua.nim b/lib/newwrap/lua/lua.nim
deleted file mode 100755
index 000e09993..000000000
--- a/lib/newwrap/lua/lua.nim
+++ /dev/null
@@ -1,399 +0,0 @@
-#*****************************************************************************
-# *                                                                            *
-# *  File:        lua.pas                                                      *
-# *  Authors:     TeCGraf           (C headers + actual Lua libraries)         *
-# *               Lavergne Thomas   (original translation to Pascal)           *
-# *               Bram Kuijvenhoven (update to Lua 5.1.1 for FreePascal)       *
-# *  Description: Basic Lua library                                            *
-# *                                                                            *
-# *****************************************************************************
-#
-#** $Id: lua.h,v 1.175 2003/03/18 12:31:39 roberto Exp $
-#** Lua - An Extensible Extension Language
-#** TeCGraf: Computer Graphics Technology Group, PUC-Rio, Brazil
-#** http://www.lua.org   mailto:info@lua.org
-#** See Copyright Notice at the end of this file
-#
-#
-#** Updated to Lua 5.1.1 by Bram Kuijvenhoven (bram at kuijvenhoven dot net),
-#**   Hexis BV (http://www.hexis.nl), the Netherlands
-#** Notes:
-#**    - Only tested with FPC (FreePascal Compiler)
-#**    - Using LuaBinaries styled DLL/SO names, which include version names
-#**    - LUA_YIELD was suffixed by '_' for avoiding name collision
-#
-#
-#** Translated to pascal by Lavergne Thomas
-#** Notes :
-#**    - Pointers type was prefixed with 'P'
-#**    - lua_upvalueindex constant was transformed to function
-#**    - Some compatibility function was isolated because with it you must have
-#**      lualib.
-#**    - LUA_VERSION was suffixed by '_' for avoiding name collision.
-#** Bug reports :
-#**    - thomas.lavergne@laposte.net
-#**   In french or in english
-#
-
-when defined(MACOSX): 
-  const 
-    NAME* = "liblua(|5.2|5.1|5.0).dylib"
-    LIB_NAME* = "liblua(|5.2|5.1|5.0).dylib"
-elif defined(UNIX): 
-  const 
-    NAME* = "liblua(|5.2|5.1|5.0).so(|.0)"
-    LIB_NAME* = "liblua(|5.2|5.1|5.0).so(|.0)"
-else: 
-  const 
-    NAME* = "lua(|5.2|5.1|5.0).dll"
-    LIB_NAME* = "lua(|5.2|5.1|5.0).dll"
-
-
-const 
-  VERSION* = "Lua 5.1"
-  RELEASE* = "Lua 5.1.1"
-  VERSION_NUM* = 501
-  COPYRIGHT* = "Copyright (C) 1994-2006 Lua.org, PUC-Rio"
-  AUTHORS* = "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
-  # option for multiple returns in `lua_pcall' and `lua_call' 
-  MULTRET* = - 1              #
-                              #** pseudo-indices
-                              #
-  REGISTRYINDEX* = - 10000
-  ENVIRONINDEX* = - 10001
-  GLOBALSINDEX* = - 10002
-
-proc upvalueindex*(I: int): int
-const                         # thread status; 0 is OK 
-  constYIELD* = 1
-  ERRRUN* = 2
-  ERRSYNTAX* = 3
-  ERRMEM* = 4
-  ERRERR* = 5
-
-type 
-  PState* = Pointer
-  CFunction* = proc (L: PState): int{.cdecl.}
-
-#
-#** functions that read/write blocks when loading/dumping Lua chunks
-#
-
-type 
-  Reader* = proc (L: PState, ud: Pointer, sz: ptr int): cstring{.cdecl.}
-  Writer* = proc (L: PState, p: Pointer, sz: int, ud: Pointer): int{.cdecl.}
-  Alloc* = proc (ud, theptr: Pointer, osize, nsize: int){.cdecl.}
-
-const 
-  TNONE* = - 1
-  TNIL* = 0
-  TBOOLEAN* = 1
-  TLIGHTUSERDATA* = 2
-  TNUMBER* = 3
-  TSTRING* = 4
-  TTABLE* = 5
-  TFUNCTION* = 6
-  TUSERDATA* = 7
-  TTHREAD* = 8                # minimum Lua stack available to a C function 
-  MINSTACK* = 20
-
-type                          # Type of Numbers in Lua 
-  Number* = float
-  Integer* = int
-
-proc newstate*(f: Alloc, ud: Pointer): PState{.cdecl, dynlib: NAME, 
-    importc: "lua_newstate".}
-proc close*(L: PState){.cdecl, dynlib: NAME, importc: "lua_close".}
-proc newthread*(L: PState): PState{.cdecl, dynlib: NAME, 
-                                    importc: "lua_newthread".}
-proc atpanic*(L: PState, panicf: CFunction): CFunction{.cdecl, dynlib: NAME, 
-    importc: "lua_atpanic".}
-proc gettop*(L: PState): int{.cdecl, dynlib: NAME, importc: "lua_gettop".}
-proc settop*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_settop".}
-proc pushvalue*(L: PState, Idx: int){.cdecl, dynlib: NAME, 
-                                      importc: "lua_pushvalue".}
-proc remove*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_remove".}
-proc insert*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_insert".}
-proc replace*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_replace".}
-proc checkstack*(L: PState, sz: int): cint{.cdecl, dynlib: NAME, 
-    importc: "lua_checkstack".}
-proc xmove*(`from`, `to`: PState, n: int){.cdecl, dynlib: NAME, 
-    importc: "lua_xmove".}
-proc isnumber*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, 
-    importc: "lua_isnumber".}
-proc isstring*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, 
-    importc: "lua_isstring".}
-proc iscfunction*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, 
-    importc: "lua_iscfunction".}
-proc isuserdata*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, 
-    importc: "lua_isuserdata".}
-proc luatype*(L: PState, idx: int): int{.cdecl, dynlib: NAME, importc: "lua_type".}
-proc typename*(L: PState, tp: int): cstring{.cdecl, dynlib: NAME, 
-    importc: "lua_typename".}
-proc equal*(L: PState, idx1, idx2: int): cint{.cdecl, dynlib: NAME, 
-    importc: "lua_equal".}
-proc rawequal*(L: PState, idx1, idx2: int): cint{.cdecl, dynlib: NAME, 
-    importc: "lua_rawequal".}
-proc lessthan*(L: PState, idx1, idx2: int): cint{.cdecl, dynlib: NAME, 
-    importc: "lua_lessthan".}
-proc tonumber*(L: PState, idx: int): Number{.cdecl, dynlib: NAME, 
-    importc: "lua_tonumber".}
-proc tointeger*(L: PState, idx: int): Integer{.cdecl, dynlib: NAME, 
-    importc: "lua_tointeger".}
-proc toboolean*(L: PState, idx: int): cint{.cdecl, dynlib: NAME, 
-    importc: "lua_toboolean".}
-proc tolstring*(L: PState, idx: int, length: ptr int): cstring{.cdecl, 
-    dynlib: NAME, importc: "lua_tolstring".}
-proc objlen*(L: PState, idx: int): int{.cdecl, dynlib: NAME, 
-    importc: "lua_objlen".}
-proc tocfunction*(L: PState, idx: int): CFunction{.cdecl, dynlib: NAME, 
-    importc: "lua_tocfunction".}
-proc touserdata*(L: PState, idx: int): Pointer{.cdecl, dynlib: NAME, 
-    importc: "lua_touserdata".}
-proc tothread*(L: PState, idx: int): PState{.cdecl, dynlib: NAME, 
-    importc: "lua_tothread".}
-proc topointer*(L: PState, idx: int): Pointer{.cdecl, dynlib: NAME, 
-    importc: "lua_topointer".}
-proc pushnil*(L: PState){.cdecl, dynlib: NAME, importc: "lua_pushnil".}
-proc pushnumber*(L: PState, n: Number){.cdecl, dynlib: NAME, 
-                                        importc: "lua_pushnumber".}
-proc pushinteger*(L: PState, n: Integer){.cdecl, dynlib: NAME, 
-    importc: "lua_pushinteger".}
-proc pushlstring*(L: PState, s: cstring, len: int){.cdecl, dynlib: NAME, 
-    importc: "lua_pushlstring".}
-proc pushstring*(L: PState, s: cstring){.cdecl, dynlib: NAME, 
-    importc: "lua_pushstring".}
-proc pushvfstring*(L: PState, fmt: cstring, argp: Pointer): cstring{.cdecl, 
-    dynlib: NAME, importc: "lua_pushvfstring".}
-proc pushfstring*(L: PState, fmt: cstring): cstring{.cdecl, varargs, 
-    dynlib: NAME, importc: "lua_pushfstring".}
-proc pushcclosure*(L: PState, fn: CFunction, n: int){.cdecl, dynlib: NAME, 
-    importc: "lua_pushcclosure".}
-proc pushboolean*(L: PState, b: cint){.cdecl, dynlib: NAME, 
-                                       importc: "lua_pushboolean".}
-proc pushlightuserdata*(L: PState, p: Pointer){.cdecl, dynlib: NAME, 
-    importc: "lua_pushlightuserdata".}
-proc pushthread*(L: PState){.cdecl, dynlib: NAME, importc: "lua_pushthread".}
-proc gettable*(L: PState, idx: int){.cdecl, dynlib: NAME, 
-                                     importc: "lua_gettable".}
-proc getfield*(L: Pstate, idx: int, k: cstring){.cdecl, dynlib: NAME, 
-    importc: "lua_getfield".}
-proc rawget*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_rawget".}
-proc rawgeti*(L: PState, idx, n: int){.cdecl, dynlib: NAME, 
-                                       importc: "lua_rawgeti".}
-proc createtable*(L: PState, narr, nrec: int){.cdecl, dynlib: NAME, 
-    importc: "lua_createtable".}
-proc newuserdata*(L: PState, sz: int): Pointer{.cdecl, dynlib: NAME, 
-    importc: "lua_newuserdata".}
-proc getmetatable*(L: PState, objindex: int): int{.cdecl, dynlib: NAME, 
-    importc: "lua_getmetatable".}
-proc getfenv*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_getfenv".}
-proc settable*(L: PState, idx: int){.cdecl, dynlib: NAME, 
-                                     importc: "lua_settable".}
-proc setfield*(L: PState, idx: int, k: cstring){.cdecl, dynlib: NAME, 
-    importc: "lua_setfield".}
-proc rawset*(L: PState, idx: int){.cdecl, dynlib: NAME, importc: "lua_rawset".}
-proc rawseti*(L: PState, idx, n: int){.cdecl, dynlib: NAME, 
-                                       importc: "lua_rawseti".}
-proc setmetatable*(L: PState, objindex: int): int{.cdecl, dynlib: NAME, 
-    importc: "lua_setmetatable".}
-proc setfenv*(L: PState, idx: int): int{.cdecl, dynlib: NAME, 
-    importc: "lua_setfenv".}
-proc call*(L: PState, nargs, nresults: int){.cdecl, dynlib: NAME, 
-    importc: "lua_call".}
-proc pcall*(L: PState, nargs, nresults, errf: int): int{.cdecl, dynlib: NAME, 
-    importc: "lua_pcall".}
-proc cpcall*(L: PState, func: CFunction, ud: Pointer): int{.cdecl, dynlib: NAME, 
-    importc: "lua_cpcall".}
-proc load*(L: PState, reader: Reader, dt: Pointer, chunkname: cstring): int{.
-    cdecl, dynlib: NAME, importc: "lua_load".}
-proc dump*(L: PState, writer: Writer, data: Pointer): int{.cdecl, dynlib: NAME, 
-    importc: "lua_dump".}
-proc luayield*(L: PState, nresults: int): int{.cdecl, dynlib: NAME, 
-    importc: "lua_yield".}
-proc resume*(L: PState, narg: int): int{.cdecl, dynlib: NAME, 
-    importc: "lua_resume".}
-proc status*(L: PState): int{.cdecl, dynlib: NAME, importc: "lua_status".}
-proc gc*(L: PState, what, data: int): int{.cdecl, dynlib: NAME, 
-    importc: "lua_gc".}
-proc error*(L: PState): int{.cdecl, dynlib: NAME, importc: "lua_error".}
-proc next*(L: PState, idx: int): int{.cdecl, dynlib: NAME, importc: "lua_next".}
-proc concat*(L: PState, n: int){.cdecl, dynlib: NAME, importc: "lua_concat".}
-proc getallocf*(L: PState, ud: ptr Pointer): Alloc{.cdecl, dynlib: NAME, 
-    importc: "lua_getallocf".}
-proc setallocf*(L: PState, f: Alloc, ud: Pointer){.cdecl, dynlib: NAME, 
-    importc: "lua_setallocf".}
-#
-#** Garbage-collection functions and options
-#
-
-const 
-  GCSTOP* = 0
-  GCRESTART* = 1
-  GCCOLLECT* = 2
-  GCCOUNT* = 3
-  GCCOUNTB* = 4
-  GCSTEP* = 5
-  GCSETPAUSE* = 6
-  GCSETSTEPMUL* = 7
-
-#
-#** ===============================================================
-#** some useful macros
-#** ===============================================================
-#
-
-proc pop*(L: PState, n: int)
-proc newtable*(L: Pstate)
-proc register*(L: PState, n: cstring, f: CFunction)
-proc pushcfunction*(L: PState, f: CFunction)
-proc strlen*(L: Pstate, i: int): int
-proc isfunction*(L: PState, n: int): bool
-proc istable*(L: PState, n: int): bool
-proc islightuserdata*(L: PState, n: int): bool
-proc isnil*(L: PState, n: int): bool
-proc isboolean*(L: PState, n: int): bool
-proc isthread*(L: PState, n: int): bool
-proc isnone*(L: PState, n: int): bool
-proc isnoneornil*(L: PState, n: int): bool
-proc pushliteral*(L: PState, s: cstring)
-proc setglobal*(L: PState, s: cstring)
-proc getglobal*(L: PState, s: cstring)
-proc tostring*(L: PState, i: int): cstring
-#
-#** compatibility macros and functions
-#
-
-proc getregistry*(L: PState)
-proc getgccount*(L: PState): int
-type 
-  Chunkreader* = Reader
-  Chunkwriter* = Writer
-
-#
-#** ======================================================================
-#** Debug API
-#** ======================================================================
-#
-
-const 
-  HOOKCALL* = 0
-  HOOKRET* = 1
-  HOOKLINE* = 2
-  HOOKCOUNT* = 3
-  HOOKTAILRET* = 4
-
-const 
-  MASKCALL* = 1 shl Ord(HOOKCALL)
-  MASKRET* = 1 shl Ord(HOOKRET)
-  MASKLINE* = 1 shl Ord(HOOKLINE)
-  MASKCOUNT* = 1 shl Ord(HOOKCOUNT)
-
-const 
-  IDSIZE* = 60
-
-type 
-  TDebug*{.final.} = object    # activation record 
-    event*: int
-    name*: cstring            # (n) 
-    namewhat*: cstring        # (n) `global', `local', `field', `method' 
-    what*: cstring            # (S) `Lua', `C', `main', `tail'
-    source*: cstring          # (S) 
-    currentline*: int         # (l) 
-    nups*: int                # (u) number of upvalues 
-    linedefined*: int         # (S) 
-    lastlinedefined*: int     # (S) 
-    short_src*: array[0..IDSIZE - 1, Char] # (S) 
-                                           # private part 
-    i_ci*: int                # active function 
-  
-  PDebug* = ptr TDebug
-  Hook* = proc (L: PState, ar: PDebug){.cdecl.}
-
-#
-#** ======================================================================
-#** Debug API
-#** ======================================================================
-#
-
-proc getstack*(L: PState, level: int, ar: PDebug): int{.cdecl, dynlib: NAME, 
-    importc: "lua_getstack".}
-proc getinfo*(L: PState, what: cstring, ar: PDebug): int{.cdecl, dynlib: NAME, 
-    importc: "lua_getinfo".}
-proc getlocal*(L: PState, ar: PDebug, n: int): cstring{.cdecl, dynlib: NAME, 
-    importc: "lua_getlocal".}
-proc setlocal*(L: PState, ar: PDebug, n: int): cstring{.cdecl, dynlib: NAME, 
-    importc: "lua_setlocal".}
-proc getupvalue*(L: PState, funcindex: int, n: int): cstring{.cdecl, 
-    dynlib: NAME, importc: "lua_getupvalue".}
-proc setupvalue*(L: PState, funcindex: int, n: int): cstring{.cdecl, 
-    dynlib: NAME, importc: "lua_setupvalue".}
-proc sethook*(L: PState, func: Hook, mask: int, count: int): int{.cdecl, 
-    dynlib: NAME, importc: "lua_sethook".}
-proc gethook*(L: PState): Hook{.cdecl, dynlib: NAME, importc: "lua_gethook".}
-proc gethookmask*(L: PState): int{.cdecl, dynlib: NAME, 
-                                   importc: "lua_gethookmask".}
-proc gethookcount*(L: PState): int{.cdecl, dynlib: NAME, 
-                                    importc: "lua_gethookcount".}
-# implementation
-
-proc upvalueindex(I: int): int = 
-  Result = GLOBALSINDEX - i
-
-proc pop(L: PState, n: int) = 
-  settop(L, - n - 1)
-
-proc newtable(L: PState) = 
-  createtable(L, 0, 0)
-
-proc register(L: PState, n: cstring, f: CFunction) = 
-  pushcfunction(L, f)
-  setglobal(L, n)
-
-proc pushcfunction(L: PState, f: CFunction) = 
-  pushcclosure(L, f, 0)
-
-proc strlen(L: PState, i: int): int = 
-  Result = objlen(L, i)
-
-proc isfunction(L: PState, n: int): bool = 
-  Result = luatype(L, n) == TFUNCTION
-
-proc istable(L: PState, n: int): bool = 
-  Result = luatype(L, n) == TTABLE
-
-proc islightuserdata(L: PState, n: int): bool = 
-  Result = luatype(L, n) == TLIGHTUSERDATA
-
-proc isnil(L: PState, n: int): bool = 
-  Result = luatype(L, n) == TNIL
-
-proc isboolean(L: PState, n: int): bool = 
-  Result = luatype(L, n) == TBOOLEAN
-
-proc isthread(L: PState, n: int): bool = 
-  Result = luatype(L, n) == TTHREAD
-
-proc isnone(L: PState, n: int): bool = 
-  Result = luatype(L, n) == TNONE
-
-proc isnoneornil(L: PState, n: int): bool = 
-  Result = luatype(L, n) <= 0
-
-proc pushliteral(L: PState, s: cstring) = 
-  pushlstring(L, s, len(s))
-
-proc setglobal(L: PState, s: cstring) = 
-  setfield(L, GLOBALSINDEX, s)
-
-proc getglobal(L: PState, s: cstring) = 
-  getfield(L, GLOBALSINDEX, s)
-
-proc tostring(L: PState, i: int): cstring = 
-  Result = tolstring(L, i, nil)
-
-proc getregistry(L: PState) = 
-  pushvalue(L, REGISTRYINDEX)
-
-proc getgccount(L: PState): int = 
-  Result = gc(L, GCCOUNT, 0)
diff --git a/lib/newwrap/lua/lualib.nim b/lib/newwrap/lua/lualib.nim
deleted file mode 100755
index 94f08a1f1..000000000
--- a/lib/newwrap/lua/lualib.nim
+++ /dev/null
@@ -1,66 +0,0 @@
-#*****************************************************************************
-# *                                                                            *
-# *  File:        lualib.pas                                                   *
-# *  Authors:     TeCGraf           (C headers + actual Lua libraries)         *
-# *               Lavergne Thomas   (original translation to Pascal)           *
-# *               Bram Kuijvenhoven (update to Lua 5.1.1 for FreePascal)       *
-# *  Description: Standard Lua libraries                                       *
-# *                                                                            *
-# *****************************************************************************
-#
-#** $Id: lualib.h,v 1.28 2003/03/18 12:24:26 roberto Exp $
-#** Lua standard libraries
-#** See Copyright Notice in lua.h
-#
-#
-#** Translated to pascal by Lavergne Thomas
-#** Bug reports :
-#**    - thomas.lavergne@laposte.net
-#**   In french or in english
-#
-
-import 
-  lua
-
-const 
-  COLIBNAME* = "coroutine"
-  TABLIBNAME* = "table"
-  IOLIBNAME* = "io"
-  OSLIBNAME* = "os"
-  STRLINAME* = "string"
-  MATHLIBNAME* = "math"
-  DBLIBNAME* = "debug"
-  LOADLIBNAME* = "package"
-
-proc open_base*(L: PState): cint{.cdecl, dynlib: LIB_NAME, 
-                                  importc: "luaopen_base".}
-proc open_table*(L: PState): cint{.cdecl, dynlib: LIB_NAME, 
-                                   importc: "luaopen_table".}
-proc open_io*(L: PState): cint{.cdecl, dynlib: LIB_NAME, importc: "luaopen_io".}
-proc open_string*(L: PState): cint{.cdecl, dynlib: LIB_NAME, 
-                                    importc: "luaopen_string".}
-proc open_math*(L: PState): cint{.cdecl, dynlib: LIB_NAME, 
-                                  importc: "luaopen_math".}
-proc open_debug*(L: PState): cint{.cdecl, dynlib: LIB_NAME, 
-                                   importc: "luaopen_debug".}
-proc open_package*(L: PState): cint{.cdecl, dynlib: LIB_NAME, 
-                                     importc: "luaopen_package".}
-proc openlibs*(L: PState){.cdecl, dynlib: LIB_NAME, importc: "luaL_openlibs".}
-
-proc baselibopen*(L: PState): Bool = 
-  Result = open_base(L) != 0'i32
-
-proc tablibopen*(L: PState): Bool = 
-  Result = open_table(L) != 0'i32
-
-proc iolibopen*(L: PState): Bool = 
-  Result = open_io(L) != 0'i32
-
-proc strlibopen*(L: PState): Bool = 
-  Result = open_string(L) != 0'i32
-
-proc mathlibopen*(L: PState): Bool = 
-  Result = open_math(L) != 0'i32
-
-proc dblibopen*(L: PState): Bool = 
-  Result = open_debug(L) != 0'i32