227 (* |
238 (* |
228 ** access functions (stack -> C) |
239 ** access functions (stack -> C) |
229 *) |
240 *) |
230 function lua_isnumber(L : Plua_State; idx : LongInt) : LongBool; |
241 function lua_isnumber(L : Plua_State; idx : LongInt) : LongBool; |
231 cdecl; external LuaLibName; |
242 cdecl; external LuaLibName; |
232 |
243 |
233 function lua_isstring(L : Plua_State; idx : LongInt) : LongBool; |
244 function lua_isstring(L : Plua_State; idx : LongInt) : LongBool; |
234 cdecl; external LuaLibName; |
245 cdecl; external LuaLibName; |
235 |
246 |
236 function lua_iscfunction(L : Plua_State; idx : LongInt) : LongBool; |
247 function lua_iscfunction(L : Plua_State; idx : LongInt) : LongBool; |
237 cdecl; external LuaLibName; |
248 cdecl; external LuaLibName; |
238 |
249 |
239 function lua_isuserdata(L : Plua_State; idx : LongInt) : LongBool; |
250 function lua_isuserdata(L : Plua_State; idx : LongInt) : LongBool; |
240 cdecl; external LuaLibName; |
251 cdecl; external LuaLibName; |
241 |
252 |
242 function lua_type(L : Plua_State; idx : LongInt) : LongInt; |
253 function lua_type(L : Plua_State; idx : LongInt) : LongInt; |
243 cdecl; external LuaLibName; |
254 cdecl; external LuaLibName; |
244 |
255 |
245 function lua_typename(L : Plua_State; tp : LongInt) : PChar; |
256 function lua_typename(L : Plua_State; tp : LongInt) : PChar; |
246 cdecl; external LuaLibName; |
257 cdecl; external LuaLibName; |
247 |
258 |
248 |
|
249 function lua_equal(L : Plua_State; idx1, idx2 : LongInt) : LongBool; |
259 function lua_equal(L : Plua_State; idx1, idx2 : LongInt) : LongBool; |
250 cdecl; external LuaLibName; |
260 cdecl; external LuaLibName; |
251 |
261 |
252 function lua_rawequal(L : Plua_State; idx1, idx2 : LongInt) : LongBool; |
262 function lua_rawequal(L : Plua_State; idx1, idx2 : LongInt) : LongBool; |
253 cdecl; external LuaLibName; |
263 cdecl; external LuaLibName; |
254 |
264 |
255 function lua_lessthan(L : Plua_State; idx1, idx2 : LongInt) : LongBool; |
265 function lua_lessthan(L : Plua_State; idx1, idx2 : LongInt) : LongBool; |
256 cdecl; external LuaLibName; |
266 cdecl; external LuaLibName; |
257 |
267 |
258 function lua_tonumber(L : Plua_State; idx : LongInt) : lua_Number; |
268 function lua_tonumber(L : Plua_State; idx : LongInt) : lua_Number; |
259 cdecl; external LuaLibName; |
269 cdecl; external LuaLibName; |
260 |
270 |
261 function lua_tointeger(L : Plua_State; idx : LongInt) : lua_Integer; |
271 function lua_tointeger(L : Plua_State; idx : LongInt) : lua_Integer; |
262 cdecl; external LuaLibName; |
272 cdecl; external LuaLibName; |
263 |
273 |
264 function lua_toboolean(L : Plua_State; idx : LongInt) : LongBool; |
274 function lua_toboolean(L : Plua_State; idx : LongInt) : LongBool; |
265 cdecl; external LuaLibName; |
275 cdecl; external LuaLibName; |
266 |
276 |
267 |
|
268 function lua_tolstring(L : Plua_State; idx : LongInt; len : Psize_t) : PChar; |
277 function lua_tolstring(L : Plua_State; idx : LongInt; len : Psize_t) : PChar; |
269 cdecl; external LuaLibName; |
278 cdecl; external LuaLibName; |
270 |
279 |
271 function lua_objlen(L : Plua_State; idx : LongInt) : size_t; |
280 function lua_objlen(L : Plua_State; idx : LongInt) : size_t; |
272 cdecl; external LuaLibName; |
281 cdecl; external LuaLibName; |
273 |
282 |
274 function lua_tocfunction(L : Plua_State; idx : LongInt) : lua_CFunction; |
283 function lua_tocfunction(L : Plua_State; idx : LongInt) : lua_CFunction; |
275 cdecl; external LuaLibName; |
284 cdecl; external LuaLibName; |
276 |
285 |
277 function lua_touserdata(L : Plua_State; idx : LongInt) : Pointer; |
286 function lua_touserdata(L : Plua_State; idx : LongInt) : Pointer; |
278 cdecl; external LuaLibName; |
287 cdecl; external LuaLibName; |
279 |
288 |
280 function lua_tothread(L : Plua_State; idx : LongInt) : Plua_State; |
289 function lua_tothread(L : Plua_State; idx : LongInt) : Plua_State; |
281 cdecl; external LuaLibName; |
290 cdecl; external LuaLibName; |
282 |
291 |
283 function lua_topointer(L : Plua_State; idx : LongInt) : Pointer; |
292 function lua_topointer(L : Plua_State; idx : LongInt) : Pointer; |
284 cdecl; external LuaLibName; |
293 cdecl; external LuaLibName; |
285 |
294 |
286 |
295 |
287 (* |
296 (* |
288 ** push functions (C -> stack) |
297 ** push functions (C -> stack) |
289 *) |
298 *) |
290 procedure lua_pushnil(L : Plua_State); |
299 procedure lua_pushnil(L : Plua_State); |
291 cdecl; external LuaLibName; |
300 cdecl; external LuaLibName; |
292 |
301 |
293 procedure lua_pushnumber(L : Plua_State; n : lua_Number); |
302 procedure lua_pushnumber(L : Plua_State; n : lua_Number); |
294 cdecl; external LuaLibName; |
303 cdecl; external LuaLibName; |
295 |
304 |
296 procedure lua_pushinteger(L : Plua_State; n : lua_Integer); |
305 procedure lua_pushinteger(L : Plua_State; n : lua_Integer); |
297 cdecl; external LuaLibName; |
306 cdecl; external LuaLibName; |
298 |
307 |
299 procedure lua_pushlstring(L : Plua_State; const s : PChar; ls : size_t); |
308 procedure lua_pushlstring(L : Plua_State; const s : PChar; ls : size_t); |
300 cdecl; external LuaLibName; |
309 cdecl; external LuaLibName; |
301 |
310 |
302 procedure lua_pushstring(L : Plua_State; const s : PChar); |
311 procedure lua_pushstring(L : Plua_State; const s : PChar); |
303 cdecl; external LuaLibName; |
312 cdecl; external LuaLibName; |
304 |
313 |
305 |
|
306 function lua_pushvfstring(L : Plua_State; |
314 function lua_pushvfstring(L : Plua_State; |
307 const fmt : PChar; argp : Pointer) : PChar; |
315 const fmt : PChar; argp : Pointer) : PChar; |
308 cdecl; external LuaLibName; |
316 cdecl; external LuaLibName; |
309 |
317 |
310 function lua_pushfstring(L : Plua_State; const fmt : PChar) : PChar; varargs; |
318 function lua_pushfstring(L : Plua_State; const fmt : PChar) : PChar; varargs; |
311 cdecl; external LuaLibName; |
319 cdecl; external LuaLibName; |
312 |
320 |
313 procedure lua_pushcclosure(L : Plua_State; fn : lua_CFunction; n : LongInt); |
321 procedure lua_pushcclosure(L : Plua_State; fn : lua_CFunction; n : LongInt); |
314 cdecl; external LuaLibName; |
322 cdecl; external LuaLibName; |
315 |
323 |
316 procedure lua_pushboolean(L : Plua_State; b : LongBool); |
324 procedure lua_pushboolean(L : Plua_State; b : LongBool); |
317 cdecl; external LuaLibName; |
325 cdecl; external LuaLibName; |
318 |
326 |
319 procedure lua_pushlightuserdata(L : Plua_State; p : Pointer); |
327 procedure lua_pushlightuserdata(L : Plua_State; p : Pointer); |
320 cdecl; external LuaLibName; |
328 cdecl; external LuaLibName; |
321 |
329 |
322 function lua_pushthread(L : Plua_state) : Cardinal; |
330 function lua_pushthread(L : Plua_state) : Cardinal; |
323 cdecl; external LuaLibName; |
331 cdecl; external LuaLibName; |
324 |
332 |
325 |
333 |
326 (* |
334 (* |
327 ** get functions (Lua -> stack) |
335 ** get functions (Lua -> stack) |
328 *) |
336 *) |
329 procedure lua_gettable(L : Plua_State ; idx : LongInt); |
337 procedure lua_gettable(L : Plua_State ; idx : LongInt); |
330 cdecl; external LuaLibName; |
338 cdecl; external LuaLibName; |
331 |
339 |
332 procedure lua_getfield(L : Plua_State; idx : LongInt; k : PChar); |
340 procedure lua_getfield(L : Plua_State; idx : LongInt; k : PChar); |
333 cdecl; external LuaLibName; |
341 cdecl; external LuaLibName; |
334 |
342 |
335 procedure lua_rawget(L : Plua_State; idx : LongInt); |
343 procedure lua_rawget(L : Plua_State; idx : LongInt); |
336 cdecl; external LuaLibName; |
344 cdecl; external LuaLibName; |
337 |
345 |
338 procedure lua_rawgeti(L : Plua_State; idx, n : LongInt); |
346 procedure lua_rawgeti(L : Plua_State; idx, n : LongInt); |
339 cdecl; external LuaLibName; |
347 cdecl; external LuaLibName; |
340 |
348 |
341 procedure lua_createtable(L : Plua_State; narr, nrec : LongInt); |
349 procedure lua_createtable(L : Plua_State; narr, nrec : LongInt); |
342 cdecl; external LuaLibName; |
350 cdecl; external LuaLibName; |
343 |
351 |
344 function lua_newuserdata(L : Plua_State; sz : size_t) : Pointer; |
352 function lua_newuserdata(L : Plua_State; sz : size_t) : Pointer; |
345 cdecl; external LuaLibName; |
353 cdecl; external LuaLibName; |
346 |
354 |
347 function lua_getmetatable(L : Plua_State; objindex : LongInt) : LongBool; |
355 function lua_getmetatable(L : Plua_State; objindex : LongInt) : LongBool; |
348 cdecl; external LuaLibName; |
356 cdecl; external LuaLibName; |
349 |
357 |
350 procedure lua_getfenv(L : Plua_State; idx : LongInt); |
358 procedure lua_getfenv(L : Plua_State; idx : LongInt); |
351 cdecl; external LuaLibName; |
359 cdecl; external LuaLibName; |
352 |
360 |
353 |
361 |
354 (* |
362 (* |
355 ** set functions (stack -> Lua) |
363 ** set functions (stack -> Lua) |
356 *) |
364 *) |
357 procedure lua_settable(L : Plua_State; idx : LongInt); |
365 procedure lua_settable(L : Plua_State; idx : LongInt); |
358 cdecl; external LuaLibName; |
366 cdecl; external LuaLibName; |
359 |
367 |
360 procedure lua_setfield(L : Plua_State; idx : LongInt; const k : PChar); |
368 procedure lua_setfield(L : Plua_State; idx : LongInt; const k : PChar); |
361 cdecl; external LuaLibName; |
369 cdecl; external LuaLibName; |
362 |
370 |
363 procedure lua_rawset(L : Plua_State; idx : LongInt); |
371 procedure lua_rawset(L : Plua_State; idx : LongInt); |
364 cdecl; external LuaLibName; |
372 cdecl; external LuaLibName; |
365 |
373 |
366 procedure lua_rawseti(L : Plua_State; idx , n: LongInt); |
374 procedure lua_rawseti(L : Plua_State; idx , n: LongInt); |
367 cdecl; external LuaLibName; |
375 cdecl; external LuaLibName; |
368 |
376 |
369 function lua_setmetatable(L : Plua_State; objindex : LongInt): LongBool; |
377 function lua_setmetatable(L : Plua_State; objindex : LongInt): LongBool; |
370 cdecl; external LuaLibName; |
378 cdecl; external LuaLibName; |
371 |
379 |
372 function lua_setfenv(L : Plua_State; idx : LongInt): LongBool; |
380 function lua_setfenv(L : Plua_State; idx : LongInt): LongBool; |
373 cdecl; external LuaLibName; |
381 cdecl; external LuaLibName; |
374 |
382 |
375 (* |
383 (* |
376 ** `load' and `call' functions (load and run Lua code) |
384 ** `load' and `call' functions (load and run Lua code) |
377 *) |
385 *) |
378 procedure lua_call(L : Plua_State; nargs, nresults : LongInt); |
386 procedure lua_call(L : Plua_State; nargs, nresults : LongInt); |
379 cdecl; external LuaLibName; |
387 cdecl; external LuaLibName; |
380 |
388 |
381 function lua_pcall(L : Plua_State; nargs, nresults, errfunc : LongInt) : LongInt; |
389 function lua_pcall(L : Plua_State; nargs, nresults, errfunc : LongInt) : LongInt; |
382 cdecl; external LuaLibName; |
390 cdecl; external LuaLibName; |
383 |
391 |
384 function lua_cpcall(L : Plua_State; func : lua_CFunction; ud : Pointer) : LongInt; |
392 function lua_cpcall(L : Plua_State; func : lua_CFunction; ud : Pointer) : LongInt; |
385 cdecl; external LuaLibName; |
393 cdecl; external LuaLibName; |
386 |
394 |
387 function lua_load(L : Plua_State; reader : lua_Reader; dt : Pointer; const chunkname : PChar) : LongInt; |
395 function lua_load(L : Plua_State; reader : lua_Reader; dt : Pointer; const chunkname : PChar) : LongInt; |
388 cdecl; external LuaLibName; |
396 cdecl; external LuaLibName; |
389 |
397 |
390 |
398 |
391 function lua_dump(L : Plua_State; writer : lua_Writer; data: Pointer) : LongInt; |
399 function lua_dump(L : Plua_State; writer : lua_Writer; data: Pointer) : LongInt; |
392 cdecl; external LuaLibName; |
400 cdecl; external LuaLibName; |
393 |
401 |
394 |
402 |
395 (* |
403 (* |
396 ** coroutine functions |
404 ** coroutine functions |
397 *) |
405 *) |
398 function lua_yield(L : Plua_State; nresults : LongInt) : LongInt; |
406 function lua_yield(L : Plua_State; nresults : LongInt) : LongInt; |
399 cdecl; external LuaLibName; |
407 cdecl; external LuaLibName; |
400 |
408 |
401 function lua_resume(L : Plua_State; narg : LongInt) : LongInt; |
409 function lua_resume(L : Plua_State; narg : LongInt) : LongInt; |
402 cdecl; external LuaLibName; |
410 cdecl; external LuaLibName; |
403 |
411 |
404 function lua_status(L : Plua_State) : LongInt; |
412 function lua_status(L : Plua_State) : LongInt; |
405 cdecl; external LuaLibName; |
413 cdecl; external LuaLibName; |
406 |
414 |
407 (* |
415 (* |
408 ** garbage-collection functions and options |
416 ** garbage-collection functions and options |
409 *) |
417 *) |
|
418 |
410 const |
419 const |
411 LUA_GCSTOP = 0; |
420 LUA_GCSTOP = 0; |
412 LUA_GCRESTART = 1; |
421 LUA_GCRESTART = 1; |
413 LUA_GCCOLLECT = 2; |
422 LUA_GCCOLLECT = 2; |
414 LUA_GCCOUNT = 3; |
423 LUA_GCCOUNT = 3; |
530 lua_Hook = procedure (L : Plua_State; ar : Plua_Debug); cdecl; |
539 lua_Hook = procedure (L : Plua_State; ar : Plua_Debug); cdecl; |
531 |
540 |
532 |
541 |
533 function lua_getstack(L : Plua_State; level : LongInt; ar : Plua_Debug) : LongInt; |
542 function lua_getstack(L : Plua_State; level : LongInt; ar : Plua_Debug) : LongInt; |
534 cdecl; external LuaLibName; |
543 cdecl; external LuaLibName; |
535 |
544 |
536 function lua_getinfo(L : Plua_State; const what : PChar; ar: Plua_Debug): LongInt; |
545 function lua_getinfo(L : Plua_State; const what : PChar; ar: Plua_Debug): LongInt; |
537 cdecl; external LuaLibName; |
546 cdecl; external LuaLibName; |
538 |
547 |
539 function lua_getlocal(L : Plua_State; ar : Plua_Debug; n : LongInt) : PChar; |
548 function lua_getlocal(L : Plua_State; ar : Plua_Debug; n : LongInt) : PChar; |
540 cdecl; external LuaLibName; |
549 cdecl; external LuaLibName; |
541 |
550 |
542 function lua_setlocal(L : Plua_State; ar : Plua_Debug; n : LongInt) : PChar; |
551 function lua_setlocal(L : Plua_State; ar : Plua_Debug; n : LongInt) : PChar; |
543 cdecl; external LuaLibName; |
552 cdecl; external LuaLibName; |
544 |
553 |
545 function lua_getupvalue(L : Plua_State; funcindex, n : LongInt) : PChar; |
554 function lua_getupvalue(L : Plua_State; funcindex, n : LongInt) : PChar; |
546 cdecl; external LuaLibName; |
555 cdecl; external LuaLibName; |
547 |
556 |
548 function lua_setupvalue(L : Plua_State; funcindex, n : LongInt) : PChar; |
557 function lua_setupvalue(L : Plua_State; funcindex, n : LongInt) : PChar; |
549 cdecl; external LuaLibName; |
558 cdecl; external LuaLibName; |
550 |
559 |
551 function lua_sethook(L : Plua_State; func : lua_Hook; mask, count: LongInt): LongInt; |
560 function lua_sethook(L : Plua_State; func : lua_Hook; mask, count: LongInt): LongInt; |
552 cdecl; external LuaLibName; |
561 cdecl; external LuaLibName; |
553 |
562 |
554 {$IFDEF LUA_GETHOOK} |
563 {$IFDEF LUA_GETHOOK} |
555 function lua_gethook(L : Plua_State) : lua_Hook; |
564 function lua_gethook(L : Plua_State) : lua_Hook; |
556 cdecl; external LuaLibName; |
565 cdecl; external LuaLibName; |
557 {$ENDIF} |
566 {$ENDIF} |
558 |
567 |
559 function lua_gethookmask(L : Plua_State) : LongInt; |
568 function lua_gethookmask(L : Plua_State) : LongInt; |
560 cdecl; external LuaLibName; |
569 cdecl; external LuaLibName; |
561 |
570 |
562 function lua_gethookcount(L : Plua_State) : LongInt; |
571 function lua_gethookcount(L : Plua_State) : LongInt; |
563 cdecl; external LuaLibName; |
572 cdecl; external LuaLibName; |
564 |
573 |
565 |
574 |
566 (*****************************************************************************) |
575 (*****************************************************************************) |