#include #include /* Needed if linking in external compiler; harmless otherwise */ #include #include "xmag.h" #include "xmagparam.h" int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { /* Declare variables */ struct xmag_param_struct xmag_param; char log_file[80]; FILE* file_ptr; int num_dev; char dev_name[80]; double dev_meas; int i; /* Get parameters */ xmagparam_fill_param_struct(&xmag_param); /* Initialize all files */ strcpy(log_file, "testlog.ru1"); file_ptr = fopen(log_file, "w"); if (file_ptr == NULL) return 0; fclose(file_ptr); /* Tests */ xmag_init(log_file, xmag_param); xmag_get_num_dev(&num_dev); printf("num_dev = %i\n", num_dev); for (i = 0; i < num_dev; i++) { xmag_get_dev_name(i, dev_name); xmag_get_dev_meas(i, &dev_meas); printf("dev_num = %i, name = %s, meas = %f\n", i, dev_name, dev_meas); } xmag_exit(); return 0; }