Example #1
0
static void iuplua_openlibs (lua_State *L) {
  lua_pushliteral(L, LUA_COPYRIGHT);
  lua_setglobal(L, "_COPYRIGHT");  /* set global _COPYRIGHT */

#ifdef USE_STATIC
  /* iuplua initialization */
  iuplua_open(L);
#ifdef IUPLUA_IMGLIB
  luaopen_iupluaimglib(L);
#endif

/* luaopen_lfs(L); */

#ifndef IUPLUA_NO_GL
  iupgllua_open(L);
/*  luaopen_luagl(L); */
#endif
#ifndef IUPLUA_NO_CD
  iupcontrolslua_open(L);
  iup_pplotlua_open(L);
  cdlua_open(L);
  cdluaiup_open(L);
#endif
#ifndef IUPLUA_NO_IM
  iupimlua_open(L);
  imlua_open(L);
  imlua_open_process(L);
#endif
#ifndef IUPLUA_NO_IM
#ifndef IUPLUA_NO_CD
  cdluaim_open(L);
#endif
#endif
#endif
}
Example #2
0
int main ( int argc, char **argv )
{
    IupOpen(&argc, &argv);
#ifndef IUPLUA_NO_GL
    IupGLCanvasOpen();
#endif
#ifndef IUPLUA_NO_CD
    IupControlsOpen();
    IupPPlotOpen();
#endif

    lua_open();

    lua_setdebug(1);

    lua_iolibopen( );
    lua_strlibopen( );
    lua_mathlibopen( );

    iuplua_open( );
    iupkey_open( );
#ifndef IUPLUA_NO_GL
    iupgllua_open();
#endif
#ifndef IUPLUA_NO_CD
    iupcontrolslua_open();
    iup_pplotlua_open();
    cdlua_open();
    cdluaiup_open();
#endif
#ifndef IUPLUA_NO_IM
    iupimlua_open();
    imlua_open();
#endif

    if (argc <= 1)
    {
        if(!iuplua_dofile("console3.lua"))
        {
#ifdef TEC_BIGENDIAN
#ifdef TEC_64
#include "loh/console3_be64.loh"
#else
#include "loh/console3_be32.loh"
#endif
#else
#ifdef TEC_64
#ifdef WIN64
#include "loh/console3_le64w.loh"
#else
#include "loh/console3_le64.loh"
#endif
#else
#include "loh/console3.loh"
#endif
#endif
        }
    }
    else
    {
        int ok = 1,
            i  = 1;

        /* Running all .lua given as arguments */
        while(ok & (i < argc))
        {
            ok = iuplua_dofile(argv[i]);
            i++;
        }

        if(!ok)
        {
            return EXIT_FAILURE;
        }
    }

#ifndef IUPLUA_NO_CD
    cdlua_close();
    IupControlsClose();
#endif
    IupClose();

    lua_close();

    return EXIT_SUCCESS;
}
Example #3
0
/* obligatory to use require"iuplua_pplot" */
int luaopen_iuplua_pplot(lua_State* L)
{
  return iup_pplotlua_open(L);
}