QSC Post Quantum Cryptographic Library 1.0.0.6c (A6)
A post quantum secure library written in Ansi C
 
Loading...
Searching...
No Matches
sysutils.h
Go to the documentation of this file.
1/* 2025 Quantum Resistant Cryptographic Solutions Corporation
2 * All Rights Reserved.
3 *
4 * NOTICE: This software and all accompanying materials are the exclusive
5 * property of Quantum Resistant Cryptographic Solutions Corporation (QRCS).
6 * The intellectual and technical concepts contained within this implementation
7 * are proprietary to QRCS and its authorized licensors and are protected under
8 * applicable U.S. and international copyright, patent, and trade secret laws.
9 *
10 * CRYPTOGRAPHIC STANDARDS:
11 * - This software includes implementations of cryptographic algorithms such as
12 * SHA3, AES, and others. These algorithms are public domain or standardized
13 * by organizations such as NIST and are NOT the property of QRCS.
14 * - However, all source code, optimizations, and implementations in this library
15 * are original works of QRCS and are protected under this license.
16 *
17 * RESTRICTIONS:
18 * - Redistribution, modification, or unauthorized distribution of this software,
19 * in whole or in part, is strictly prohibited.
20 * - This software is provided for non-commercial, educational, and research
21 * purposes only. Commercial use in any form is expressly forbidden.
22 * - Licensing and authorized distribution are solely at the discretion of QRCS.
23 * - Any use of this software implies acceptance of these restrictions.
24 *
25 * DISCLAIMER:
26 * This software is provided "as is," without warranty of any kind, express or
27 * implied, including but not limited to warranties of merchantability or fitness
28 * for a particular purpose. QRCS disclaims all liability for any direct, indirect,
29 * incidental, or consequential damages resulting from the use or misuse of this software.
30 *
31 * FULL LICENSE:
32 * This software is subject to the **Quantum Resistant Cryptographic Solutions
33 * Proprietary License (QRCS-PL)**. The complete license terms are included
34 * in the LICENSE.txt file distributed with this software.
35 *
36 * Written by: John G. Underhill
37 * Contact: john.underhill@protonmail.com
38 */
39
40#ifndef QSC_SYSUTILS_H
41#define QSC_SYSUTILS_H
42
43#include "common.h"
44
45QSC_CPLUSPLUS_ENABLED_START
46
67
68/* bogus winbase.h error */
70
71
75#define QSC_SYSUTILS_SYSTEM_NAME_MAX 256ULL
76
81#define QSC_USERNAME_SYSTEM_NAME_MAX 256ULL
82
90
95QSC_EXPORT_API typedef struct
96{
97 uint64_t free;
98 uint64_t total;
99 uint64_t avail;
100}
102
110
115QSC_EXPORT_API typedef struct
116{
117 uint64_t phystotal;
118 uint64_t physavail;
119 uint64_t virttotal;
120 uint64_t virtavail;
121}
123
130
137
144
152QSC_EXPORT_API size_t qsc_sysutils_user_name(char* name);
153
160
167
174QSC_EXPORT_API void qsc_sysutils_user_identity(const char* name, char* id);
175
176#if defined(QSC_DEBUG_MODE)
180QSC_EXPORT_API void qsc_system_values_print(void);
181#endif
182
183QSC_CPLUSPLUS_ENABLED_END
184
185#endif
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition common.h:520
#define QSC_SYSTEM_CONDITION_IGNORE(x)
MSVC-specific macro to disable a specific warning condition.
Definition common.h:784
The drive_space state structure.
Definition sysutils.h:96
uint64_t free
Definition sysutils.h:97
uint64_t total
Definition sysutils.h:98
uint64_t avail
Definition sysutils.h:99
The memory_statistics state structure.
Definition sysutils.h:116
uint64_t physavail
Definition sysutils.h:118
uint64_t virtavail
Definition sysutils.h:120
uint64_t virttotal
Definition sysutils.h:119
uint64_t phystotal
Definition sysutils.h:117
QSC_EXPORT_API void qsc_sysutils_memory_statistics(qsc_sysutils_memory_statistics_state *state)
Get the memory statistics from the system.
Definition sysutils.c:121
QSC_EXPORT_API uint64_t qsc_sysutils_system_timestamp(void)
Get the current high-resolution time-stamp.
Definition sysutils.c:268
QSC_EXPORT_API void qsc_sysutils_user_identity(const char *name, char *id)
Get the users identity string.
QSC_EXPORT_API uint64_t qsc_sysutils_system_uptime(void)
Get the system up-time since boot.
Definition sysutils.c:244
QSC_EXPORT_API size_t qsc_sysutils_user_name(char *name)
Get the systems logged-on user name string.
Definition sysutils.c:217
QSC_EXPORT_API bool qsc_sysutils_rdtsc_available(void)
Get the RDTSC availability status.
Definition sysutils.c:200
QSC_EXPORT_API size_t qsc_sysutils_computer_name(char *name)
Get the computer string name.
Definition sysutils.c:62
QSC_EXPORT_API uint32_t qsc_sysutils_process_id(void)
Get the current process id.
Definition sysutils.c:187
QSC_EXPORT_API void qsc_sysutils_drive_space(const char *drive, qsc_sysutils_drive_space_state *state)
Get the system drive space statistics.
Definition sysutils.c:84