// Automatically generated C++ file on Fri Jun 20 11:00:53 2025 // // To build with Digital Mars C++ Compiler: // // dmc -mn -WD stepparms.cpp kernel32.lib extern "C" __declspec(dllexport) int (*Display)(const char *format, ...) = 0; // works like printf() extern "C" __declspec(dllexport) const double *DegreesC = 0; // pointer to current circuit temperature extern "C" __declspec(dllexport) const int *StepNumber = 0; // pointer to current step number extern "C" __declspec(dllexport) const int *NumberSteps = 0; // pointer to estimated number of steps extern "C" __declspec(dllexport) const char* const *InstanceName = 0; // pointer to address of instance name extern "C" __declspec(dllexport) const char *QUX = 0; // path to QUX.exe extern "C" __declspec(dllexport) const bool *ForKeeps = 0; // pointer to whether being evaluated non-hypothetically extern "C" __declspec(dllexport) const bool *HoldICs = 0; // pointer to whether instance initial conditions are being held extern "C" __declspec(dllexport) int (*DFFT)(struct sComplex *u, bool inv, unsigned int N, double scale) = 0; // discrete Fast Fourier function 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 Vin #undef Vout #undef Vparm extern "C" __declspec(dllexport) void stepparms(void **opaque, double t, union uData *data) { double Vin = data[0].d; // input double StepParm = data[1].d; // input parameter double &Vout = data[2].d; // output double &Vparm = data[3].d; // output // Implement module evaluation code here: Vout = Vin; // copy from input pin Vparm = StepParm; // copy from attribute static int stepNbr = 0; if (stepNbr == *StepNumber) return; stepNbr = *StepNumber; Display("Step #%d: StepParm attribute = %f\n", stepNbr, StepParm); }