rocksdb/include/rocksdb/utilities/lua/rocks_lua_custom_library.h
David Lai 3be9b36453 comment unused parameters to turn on -Wunused-parameter flag
Summary:
This PR comments out the rest of the unused arguments which allow us to turn on the -Wunused-parameter flag. This is the second part of a codemod relating to https://github.com/facebook/rocksdb/pull/3557.
Closes https://github.com/facebook/rocksdb/pull/3662

Differential Revision: D7426121

Pulled By: Dayvedde

fbshipit-source-id: 223994923b42bd4953eb016a0129e47560f7e352
2018-04-12 17:59:16 -07:00

44 lines
1.5 KiB
C++

// Copyright (c) 2016, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
#pragma once
#ifdef LUA
// lua headers
extern "C" {
#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>
}
namespace rocksdb {
namespace lua {
// A class that used to define custom C Library that is callable
// from Lua script
class RocksLuaCustomLibrary {
public:
virtual ~RocksLuaCustomLibrary() {}
// The name of the C library. This name will also be used as the table
// (namespace) in Lua that contains the C library.
virtual const char* Name() const = 0;
// Returns a "static const struct luaL_Reg[]", which includes a list of
// C functions. Note that the last entry of this static array must be
// {nullptr, nullptr} as required by Lua.
//
// More details about how to implement Lua C libraries can be found
// in the official Lua document http://www.lua.org/pil/26.2.html
virtual const struct luaL_Reg* Lib() const = 0;
// A function that will be called right after the library has been created
// and pushed on the top of the lua_State. This custom setup function
// allows developers to put additional table or constant values inside
// the same table / namespace.
virtual void CustomSetup(lua_State* /*L*/) const {}
};
} // namespace lua
} // namespace rocksdb
#endif // LUA