api.hpp (1657B)
1 /* ReaPack: Package manager for REAPER 2 * Copyright (C) 2015-2025 Christian Fillion 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef REAPACK_API_HPP 19 #define REAPACK_API_HPP 20 21 #include <string> 22 23 struct APIFunc { 24 const char *name; 25 void *cImpl; 26 void *reascriptImpl; 27 void *definition; 28 }; 29 30 class APIReg { 31 public: 32 APIReg(const APIFunc *); 33 APIReg(const APIReg &) = delete; 34 ~APIReg(); 35 36 private: 37 const APIFunc *m_func; 38 39 // REAPER < 6.67 requires these strings to remain valid after registering 40 std::string m_impl; 41 std::string m_vararg; 42 std::string m_help; 43 }; 44 45 namespace API { 46 // api_misc.cpp 47 extern APIFunc BrowsePackages; 48 extern APIFunc CompareVersions; 49 extern APIFunc ProcessQueue; 50 51 // api_package.cpp 52 extern APIFunc AboutInstalledPackage; 53 extern APIFunc EnumOwnedFiles; 54 extern APIFunc FreeEntry; 55 extern APIFunc GetEntryInfo; 56 extern APIFunc GetOwner; 57 58 // api_repo.cpp 59 extern APIFunc AboutRepository; 60 extern APIFunc AddSetRepository; 61 extern APIFunc GetRepositoryInfo; 62 }; 63 64 #endif