Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <string>
- #include <cstring>
- #include <sstream>
- extern "C"
- {
- __declspec(dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function);
- __declspec(dllexport) int __stdcall RVExtensionArgs(char *output, int outputSize, const char *function, const char **argv, int argc);
- __declspec(dllexport) void __stdcall RVExtensionVersion(char *output, int outputSize);
- }
- void __stdcall RVExtension(char *output, int outputSize, const char *function)
- {
- if (function == "test1") {
- std::strncpy(output, "test1", outputSize - 1);
- }
- else if (function == "test2") {
- std::strncpy(output, "test2", outputSize - 1);
- }
- }
- int __stdcall RVExtensionArgs(char *output, int outputSize, const char *function, const char **argv, int argc)
- {
- std::stringstream sstream;
- for (int i = 0; i < argc; i++)
- {
- sstream << argv[i];
- }
- std::strncpy(output, sstream.str().c_str(), outputSize - 1);
- return 0;
- }
- void __stdcall RVExtensionVersion(char *output, int outputSize)
- {
- std::strncpy(output, "Test-Extension v1.0", outputSize - 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement