Skip to content

Commit

Permalink
Update copyright year, add dump function
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhD committed Mar 13, 2019
1 parent 466e21b commit c1a8cb1
Show file tree
Hide file tree
Showing 274 changed files with 676 additions and 275 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/Common/Core.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindCatch.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindKaguyaBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLua/set_version_vars.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLuaBridgeBuild.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLuaBuild.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLuaBuild/LuaJIT.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLuaBuild/LuaVanilla.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindLuwraBuild.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindToLuappBuild.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion cmake/sol2-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol3
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion examples/interop/LuaBridge/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion examples/interop/kaguya/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion examples/interop/luwra/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion examples/interop/tolua/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion examples/require_dll_example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
# Copyright (c) 2013-2019 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion include/sol/as_args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The MIT License (MIT)

// Copyright (c) 2013-2018 Rapptz, ThePhD and contributors
// Copyright (c) 2013-2019 Rapptz, ThePhD and contributors

// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion include/sol/as_returns.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The MIT License (MIT)

// Copyright (c) 2013-2018 Rapptz, ThePhD and contributors
// Copyright (c) 2013-2019 Rapptz, ThePhD and contributors

// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion include/sol/bind_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The MIT License (MIT)

// Copyright (c) 2013-2018 Rapptz, ThePhD and contributors
// Copyright (c) 2013-2019 Rapptz, ThePhD and contributors

// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
100 changes: 100 additions & 0 deletions include/sol/bytecode.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// sol3

// The MIT License (MIT)

// Copyright (c) 2013-2019 Rapptz, ThePhD and contributors

// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#ifndef SOL_BYTECODE_HPP
#define SOL_BYTECODE_HPP

#include "compatibility.hpp"
#include "string_view.hpp"
#include <vector>
#include <cstdint>
#include <cstddef>

namespace sol {

template <typename Allocator = std::allocator<std::byte>>
class basic_bytecode : private std::vector<std::byte, Allocator> {
private:
using base_t = std::vector<std::byte, Allocator>;

public:
using base_t::value_type;

using base_t::base_t;
using base_t::operator=;

using base_t::data;
using base_t::empty;
using base_t::max_size;
using base_t::size;

using base_t::at;
using base_t::operator[];
using base_t::back;
using base_t::front;

using base_t::begin;
using base_t::cbegin;
using base_t::cend;
using base_t::end;

using base_t::crbegin;
using base_t::crend;
using base_t::rbegin;
using base_t::rend;


using base_t::swap;
using base_t::get_allocator;

using base_t::emplace;
using base_t::emplace_back;
using base_t::insert;
using base_t::pop_back;
using base_t::push_back;
using base_t::reserve;
using base_t::resize;
using base_t::shrink_to_fit;

string_view as_string_view () const {
return string_view(reinterpret_cast<const char*>(this->data()), this->size());
}
};

using bytecode = basic_bytecode<>;

inline int bytecode_dump_writer(lua_State*, const void* memory, size_t memory_size, void* userdata) {
const std::byte* p_code = static_cast<const std::byte*>(memory);
bytecode& bc = *static_cast<bytecode*>(userdata);
try {
bc.insert(bc.cend(), p_code, p_code + memory_size);
}
catch ( ... ) {
return -1;
}
return 0;
}

} // namespace sol

#endif // SOL_BYTECODE_HPP
2 changes: 1 addition & 1 deletion include/sol/call.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The MIT License (MIT)

// Copyright (c) 2013-2018 Rapptz, ThePhD and contributors
// Copyright (c) 2013-2019 Rapptz, ThePhD and contributors

// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion include/sol/compatibility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The MIT License (MIT)

// Copyright (c) 2013-2018 Rapptz, ThePhD and contributors
// Copyright (c) 2013-2019 Rapptz, ThePhD and contributors

// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion include/sol/compatibility/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The MIT License (MIT)

// Copyright (c) 2013-2018 Rapptz, ThePhD and contributors
// Copyright (c) 2013-2019 Rapptz, ThePhD and contributors

// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion include/sol/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The MIT License (MIT)

// Copyright (c) 2013-2018 Rapptz, ThePhD and contributors
// Copyright (c) 2013-2019 Rapptz, ThePhD and contributors

// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion include/sol/config_setup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The MIT License (MIT)

// Copyright (c) 2013-2018 Rapptz, ThePhD and contributors
// Copyright (c) 2013-2019 Rapptz, ThePhD and contributors

// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
Loading

0 comments on commit c1a8cb1

Please sign in to comment.