SimovaTrack V4.7.0
Simova Track codebase, written for testing and deployment for Simova
Loading...
Searching...
No Matches
entrypoint_native.h
Go to the documentation of this file.
1#pragma once
2#warning "Entrypoint Native"
3// #include <stdio.h>
4
5// int abstracted_main()
6// {
7// printf("Hello World from PlatformIO!\n");
8// return 0;
9// }
10
11#include <iostream>
12#include <string>
13#include <chrono>
14#include <ctime>
15
16#ifdef _WIN32
17#include <windows.h>
18#else
19#include <unistd.h>
20#include <sys/utsname.h>
21#endif
22
23std::string getOperatingSystem()
24{
25#ifdef _WIN32
26 return "Windows";
27#else
28 struct utsname buffer;
29 if (uname(&buffer) == 0)
30 {
31 return std::string(buffer.sysname) + " " + buffer.release;
32 }
33 return "Unknown";
34#endif
35}
36
37std::string getCurrentTime()
38{
39 auto now = std::chrono::system_clock::now();
40 std::time_t now_time = std::chrono::system_clock::to_time_t(now);
41 return std::ctime(&now_time);
42}
43
45{
46 std::cout << "Operating System: " << getOperatingSystem() << std::endl;
47 std::cout << "Current Time: " << getCurrentTime();
48
49#ifdef _WIN32
50 SYSTEM_INFO siSysInfo;
51 GetSystemInfo(&siSysInfo);
52 std::cout << "Processor Count: " << siSysInfo.dwNumberOfProcessors << std::endl;
53 std::cout << "Page Size: " << siSysInfo.dwPageSize << " Bytes" << std::endl;
54#else
55 long nprocs = sysconf(_SC_NPROCESSORS_ONLN);
56 long pagesize = sysconf(_SC_PAGESIZE);
57 std::cout << "Processor Count: " << nprocs << std::endl;
58 std::cout << "Page Size: " << pagesize << " Bytes" << std::endl;
59#endif
60}
61
63{
64 std::cout << "Hello from Desktop Application!" << std::endl;
66 return 0;
67}
int abstracted_main()
Definition entrypoint_native.h:62
void print_device_information()
Definition entrypoint_native.h:44
std::string getOperatingSystem()
Definition entrypoint_native.h:23
std::string getCurrentTime()
Definition entrypoint_native.h:37