QSC Post Quantum Cryptographic Library 1.0.0.6c (A6)
A post quantum secure library written in Ansi C
 
Loading...
Searching...
No Matches
folderutils.h
Go to the documentation of this file.
1/*
2 * 2025 Quantum Resistant Cryptographic Solutions Corporation
3 * All Rights Reserved.
4 *
5 * NOTICE: This software and all accompanying materials are the exclusive
6 * property of Quantum Resistant Cryptographic Solutions Corporation (QRCS).
7 * The intellectual and technical concepts contained within this implementation
8 * are proprietary to QRCS and its authorized licensors and are protected under
9 * applicable U.S. and international copyright, patent, and trade secret laws.
10 *
11 * CRYPTOGRAPHIC STANDARDS:
12 * - This software includes implementations of cryptographic algorithms such as
13 * SHA3, AES, and others. These algorithms are public domain or standardized
14 * by organizations such as NIST and are NOT the property of QRCS.
15 * - However, all source code, optimizations, and implementations in this library
16 * are original works of QRCS and are protected under this license.
17 *
18 * RESTRICTIONS:
19 * - Redistribution, modification, or unauthorized distribution of this software,
20 * in whole or in part, is strictly prohibited.
21 * - This software is provided for non-commercial, educational, and research
22 * purposes only. Commercial use in any form is expressly forbidden.
23 * - Licensing and authorized distribution are solely at the discretion of QRCS.
24 * - Any use of this software implies acceptance of these restrictions.
25 *
26 * DISCLAIMER:
27 * This software is provided "as is," without warranty of any kind, express or
28 * implied, including but not limited to warranties of merchantability or fitness
29 * for a particular purpose. QRCS disclaims all liability for any direct, indirect,
30 * incidental, or consequential damages resulting from the use or misuse of this software.
31 *
32 * FULL LICENSE:
33 * This software is subject to the **Quantum Resistant Cryptographic Solutions
34 * Proprietary License (QRCS-PL)**. The complete license terms are included
35 * in the LICENSE.txt file distributed with this software.
36 *
37 * Written by: John G. Underhill
38 * Contact: john.underhill@protonmail.com
39 */
40
41#ifndef QSC_FOLDERUTILS_H
42#define QSC_FOLDERUTILS_H
43
44#include "common.h"
45#include <stdio.h>
46
47QSC_CPLUSPLUS_ENABLED_START
48
49/* bogus winbase.h error */
51
52
75
76#if defined(QSC_SYSTEM_OS_WINDOWS)
77 static const char QSC_FOLDERUTILS_DELIMITER = '\\';
78#else
79 static const char QSC_FOLDERUTILS_DELIMITER = '/';
80#endif
81
99
108
118
128
138
149QSC_EXPORT_API size_t qsc_folderutils_directory_list(char* result, size_t reslen, const char* directory);
150
160
170
171#if defined(QSC_DEBUG_MODE)
177QSC_EXPORT_API void qsc_folderutils_test(void);
178#endif
179
180QSC_CPLUSPLUS_ENABLED_END
181
182#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
#define QSC_SYSTEM_MAX_PATH
The maximum path length supported by the system.
Definition common.h:663
QSC_EXPORT_API bool qsc_folderutils_delete_directory(const char path[QSC_SYSTEM_MAX_PATH])
Delete a folder.
Definition folderutils.c:55
qsc_folderutils_directories
The system special folders enumeration.
Definition folderutils.h:87
@ qsc_folderutils_directories_user_desktop
Definition folderutils.h:89
@ qsc_folderutils_directories_user_music
Definition folderutils.h:93
@ qsc_folderutils_directories_user_favourites
Definition folderutils.h:92
@ qsc_folderutils_directories_user_shortcuts
Definition folderutils.h:96
@ qsc_folderutils_directories_user_pictures
Definition folderutils.h:94
@ qsc_folderutils_directories_user_app_data
Definition folderutils.h:88
@ qsc_folderutils_directories_user_programs
Definition folderutils.h:95
@ qsc_folderutils_directories_user_downloads
Definition folderutils.h:91
@ qsc_folderutils_directories_user_videos
Definition folderutils.h:97
@ qsc_folderutils_directories_user_documents
Definition folderutils.h:90
QSC_EXPORT_API size_t qsc_folderutils_directory_list(char *result, size_t reslen, const char *directory)
Write a list of directories to a string, delineated by newline characters.
Definition folderutils.c:95
QSC_EXPORT_API void qsc_folderutils_get_directory(qsc_folderutils_directories directory, char output[QSC_SYSTEM_MAX_PATH])
Get the full path to a special system folder.
Definition folderutils.c:198
QSC_EXPORT_API bool qsc_folderutils_directory_exists(const char path[QSC_SYSTEM_MAX_PATH])
Check if a folder exists.
Definition folderutils.c:68
QSC_EXPORT_API void qsc_folderutils_append_delimiter(char path[QSC_SYSTEM_MAX_PATH])
Append a folder path delimiter.
Definition folderutils.c:28
QSC_EXPORT_API bool qsc_folderutils_create_directory(const char path[QSC_SYSTEM_MAX_PATH])
Create a new folder.
Definition folderutils.c:42
QSC_EXPORT_API bool qsc_folderutils_directory_has_delimiter(const char path[QSC_SYSTEM_MAX_PATH])
Check if the folder path ends in a delimiter.
Definition folderutils.c:318