// Automatically generated C++ file on Fri Apr 26 07:37:01 2024 // // To build with Digital Mars C++ Compiler: // // dmc -mn -WD digitalparam.cpp kernel32.lib union uData { bool b; char c; unsigned char uc; short s; unsigned short us; int i; unsigned int ui; float f; double d; long long int i64; unsigned long long int ui64; char *str; unsigned char *bytes; }; // int DllMain() must exist and return 1 for a process to load the .DLL // See https://docs.microsoft.com/en-us/windows/win32/dlls/dllmain for more information. int __stdcall DllMain(void *module, unsigned int reason, void *reserved) { return 1; } // #undef pin names lest they collide with names in any header file(s) you might include. #undef in0 #undef in1 #undef in2 #undef in3 #undef out0 #undef out1 #undef out2 #undef out3 extern "C" __declspec(dllexport) void digitalparam(void **opaque, double t, union uData *data) { double in0 = data[0].d; // input double in1 = data[1].d; // input double in2 = data[2].d; // input double in3 = data[3].d; // input double gain1 = data[4].d; // input parameter double &out0 = data[5].d; // output double &out1 = data[6].d; // output double &out2 = data[7].d; // output double &out3 = data[8].d; // output // Implement module evaluation code here: out0=gain1*in0; }