lua/lapi.h
author Ryan C. Gordon <icculus@icculus.org>
Sun, 18 Jun 2017 19:50:43 -0400
changeset 57 4974e5368a29
parent 0 d7ee4e2ed49d
permissions -rw-r--r--
Minor type cleanup ("unsigned char" -> "uint8_t").
icculus@0
     1
/*
icculus@0
     2
** $Id: lapi.h,v 2.7.1.1 2013/04/12 18:48:47 roberto Exp $
icculus@0
     3
** Auxiliary functions from Lua API
icculus@0
     4
** See Copyright Notice in lua.h
icculus@0
     5
*/
icculus@0
     6
icculus@0
     7
#ifndef lapi_h
icculus@0
     8
#define lapi_h
icculus@0
     9
icculus@0
    10
icculus@0
    11
#include "llimits.h"
icculus@0
    12
#include "lstate.h"
icculus@0
    13
icculus@0
    14
#define api_incr_top(L)   {L->top++; api_check(L, L->top <= L->ci->top, \
icculus@0
    15
				"stack overflow");}
icculus@0
    16
icculus@0
    17
#define adjustresults(L,nres) \
icculus@0
    18
    { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; }
icculus@0
    19
icculus@0
    20
#define api_checknelems(L,n)	api_check(L, (n) < (L->top - L->ci->func), \
icculus@0
    21
				  "not enough elements in the stack")
icculus@0
    22
icculus@0
    23
icculus@0
    24
#endif