GithubHelp home page GithubHelp logo

luapp's Introduction

Lua API++ library

Lua API++ library is a C++ wrapper for Lua API. The goal of this library is to let you operate Lua using simple expressive syntax.

##Current status Lua 5.3 support is added.

##Most noticeable features provided by the library:

  • automatic stack management;
  • natural expressions (indexing, calls, arithmetics, concatenation);
  • full support of multi-value returns;
  • userdata support;
  • easy table creation and handling;
  • automatic wrapping of functions;
  • support for Lua 5.1 (compatible with LuaJIT), 5.2 and 5.3.

##Information The library comes fully documented. Dive head-in with motivational example, get acquainted with basic concepts or see what's new in the changelog.

##Most noticeable unsupported features:

  • debug;
  • coroutines;
  • string buffers.

The library requires C++11 compatible compiler. It is distributed under terms of MIT license.

luapp's People

Contributors

oldfisher avatar tnovits-d2d avatar newnon avatar thephd avatar

Stargazers

lak avatar

Watchers

 avatar

luapp's Issues

Insufficient Context::push overload

compiling testContextFutil.cpp
/usr/bin/g++ -m64 -g -O0 -Wall -Wextra -pipe -fvisibility=default -fPIC -Ilua-api-pp -Ilua-api-pp/luapp -Ilua-api-pp/test -c lua-api-pp/test/testContextAccessors.cpp -o lua-api-pp/.bld/luapp-Native-Debug/qtc_Native_13ebe065-debug/luapp-test.qtc-Native-13ebe065.f9266a53/.obj/a94a8fe5ccb19ba6/testContextAccessors.cpp.o -std=c++1y
In file included from lua-api-pp/luapp/lua.hpp:93:0,
                 from lua-api-pp/test/fixtures.h:4,
                 from lua-api-pp/test/testContextAccessors.cpp:3:
lua-api-pp/luapp/lua_impl.hxx: In instantiation of ‘void lua::_::lazyImmediateValue< <template-parameter-1-1> >::push(lua::Context&) [with ValueType = long unsigned int]’:
lua-api-pp/luapp/lua_lazy.hxx:442:5:   required from ‘void lua::_::Lazy<Policy>::push() [with Policy = lua::_::lazyImmediateValue<long unsigned int>]’
lua-api-pp/luapp/lua_impl.hxx:898:5:   required from ‘static void lua::_::lazyConcatSelector::pushOnly(lua::Context&, lua::_::Lazy<lua::_::lazyImmediateValue<lua::_::Lazy<lua::_::lazyConcat<VT11, VT12> > > >&, lua::_::Lazy<lua::_::lazyImmediateValue<VT2> >&) [with VT11 = lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyWhere>, const char*> >, long unsigned int> >; VT12 = const char*; VT2 = long unsigned int]’
lua-api-pp/luapp/lua_operations.hxx:162:33:   required from ‘void lua::_::lazyConcat< <template-parameter-1-1>, <template-parameter-1-2> >::pushOnly(lua::Context&) [with VT1 = lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyWhere>, const char*> >, long unsigned int> >, const char*> >; VT2 = long unsigned int]’
lua-api-pp/luapp/lua_lazy.hxx:454:5:   required from ‘void lua::_::Lazy<Policy>::pushOnly() [with Policy = lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyWhere>, const char*> >, long unsigned int> >, const char*> >, long unsigned int>]’
lua-api-pp/luapp/lua_lazy.hxx:728:5:   required from ‘void lua::_::lazyImmediateValue<lua::_::Lazy<Policy> >::pushOnly(lua::Context&) [with Policy = lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyWhere>, const char*> >, long unsigned int> >, const char*> >, long unsigned int>]’
lua-api-pp/luapp/lua_lazy.hxx:454:5:   [ skipping 4 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
lua-api-pp/luapp/lua_lazy.hxx:442:5:   required from ‘void lua::_::Lazy<Policy>::push() [with Policy = lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyWhere>, const char*> >, long unsigned int> >, const char*> >, long unsigned int> >, const char*>]’
lua-api-pp/luapp/lua_context.hxx:757:4:   required from ‘void lua::Context::push(lua::_::Lazy<Policy>&&) [with Policy = lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyWhere>, const char*> >, long unsigned int> >, const char*> >, long unsigned int> >, const char*>]’
lua-api-pp/luapp/lua_context.hxx:684:4:   required from ‘void lua::Context::ipush(T&&) [with T = lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyWhere>, const char*> >, long unsigned int> >, const char*> >, long unsigned int> >, const char*> >]’
lua-api-pp/luapp/lua_context.hxx:294:4:   required from ‘lua::Retval lua::Context::error(MsgType&&) [with MsgType = lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyConcat<lua::_::Lazy<lua::_::lazyWhere>, const char*> >, long unsigned int> >, const char*> >, long unsigned int> >, const char*> >]’
lua-api-pp/luapp/lua_impl.hxx:1487:9:   required from ‘void lua::Context::requireArgs(size_t) [with ArgTypes = {double, void, const char*, lua::Retval (*)(lua::Context&)}; size_t = long unsigned int]’
lua-api-pp/test/testContextAccessors.cpp:85:60:   required from here
lua-api-pp/luapp/lua_impl.hxx:405:4: error: call of overloaded ‘push(long unsigned int&)’ is ambiguous
    S.push(V);
    ^
In file included from lua-api-pp/luapp/lua.hpp:91:0,
                 from lua-api-pp/test/fixtures.h:4,
                 from lua-api-pp/test/testContextAccessors.cpp:3:
lua-api-pp/luapp/lua_context.hxx:697:8: note: candidate: void lua::Context::push(bool)
   void push(bool) noexcept;
        ^
lua-api-pp/luapp/lua_context.hxx:721:8: note: candidate: void lua::Context::push(int)
   void push(int val) noexcept
        ^
lua-api-pp/luapp/lua_context.hxx:726:8: note: candidate: void lua::Context::push(unsigned int)
   void push(unsigned int val) noexcept
        ^
lua-api-pp/luapp/lua_context.hxx:731:8: note: candidate: void lua::Context::push(long long int)
   void push(long long val) noexcept;
        ^
lua-api-pp/luapp/lua_context.hxx:732:8: note: candidate: void lua::Context::push(long long unsigned int)
   void push(unsigned long long val) noexcept;
        ^
lua-api-pp/luapp/lua_context.hxx:734:8: note: candidate: void lua::Context::push(float)
   void push(float val) noexcept
        ^
lua-api-pp/luapp/lua_context.hxx:739:8: note: candidate: void lua::Context::push(double)
   void push(double) noexcept;
        ^

Filenames prefix

It makes sense for 'source-based' "c++" library to use prefix in its file names.

VS-specific keyword __cdecl

compiling impl.cpp
/usr/bin/g++ -m64 -g -O0 -Wall -Wextra -pipe -fvisibility=default -fPIC -Ilua-api-pp -Ilua-api-pp/luapp -Ilua-api-pp/test -c lua-api-pp/luapp/impl.cpp -o lua-api-pp/.bld/luapp-Native-Debug/qtc_Native_13ebe065-debug/luapp-test.qtc-Native-13ebe065.f9266a53/.obj/373461db414d3309/impl.cpp.o -std=c++1y
In file included from lua-api-pp/luapp/lua.hpp:94:0,
                 from lua-api-pp/luapp/impl.cpp:17:
lua-api-pp/luapp/lua_state.hxx:30:24: error: expected ‘,’ or ‘...’ before ‘(’ token
   explicit State(void* (__cdecl customAllocatorFunction) (void* ud, void* ptr, size_t oldSize, size_t newSize), void* ud = nullptr);
                        ^

Ambiguous header name lua.hpp

Header lua.hpp is in distribution since Lua 5.2.
So "luapp/lua.hpp" is conflicting with the system-wide header "/usr/include/lua.hpp".

Using of std::ptrdiff_t without the namespace

/usr/bin/g++ -m64 -g -O0 -Wall -Wextra -pipe -fvisibility=default -fPIC -Ilua-api-pp -Ilua-api-pp/luapp -Ilua-api-pp/test -c lua-api-pp/test/fixtures.cpp -o lua-api-pp/.bld/luapp-Native-Debug/qtc_Native_13ebe065-debug/luapp-test.qtc-Native-13ebe065.f9266a53/.obj/a94a8fe5ccb19ba6/fixtures.cpp.o -std=c++1y
In file included from lua-api-pp/luapp/lua.hpp:55:0,
                 from lua-api-pp/test/fixtures.cpp:1:
lua-api-pp/luapp/lua_valueset.hxx:110:4: error: ‘ptrdiff_t’ does not name a type
    ptrdiff_t operator - (const vsCIterator& rhs) const noexcept
    ^
lua-api-pp/luapp/lua_valueset.hxx:237:4: error: ‘ptrdiff_t’ does not name a type
    ptrdiff_t operator - (const vsIterator& rhs) const noexcept
    ^
In file included from lua-api-pp/luapp/lua.hpp:55:0,
                 from lua-api-pp/test/fixtures.cpp:1:
lua-api-pp/luapp/lua_valueset.hxx:333:11: error: ‘ptrdiff_t’ does not name a type
   typedef ptrdiff_t difference_type; //!< @brief Index difference.
           ^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.