PQS: Post Quantum Shell 1.0.0.0a (A1)
A quantum safe shell application
interpreter.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 PQS_SERVER_INTERPRETER_H
41#define PQS_SERVER_INTERPRETER_H
42
43#include "common.h"
44
58
65#define PQS_INTERPRETER_COMMAND_BUFFER_SIZE 128
66
73#define PQS_INTERPRETER_COMMAND_EXECUTE_SIZE 10240000
74
88PQS_EXPORT_API bool pqs_interpreter_extract_paramater(char* param, const char* message);
89
104PQS_EXPORT_API bool pqs_interpreter_extract_paramaters(char* param1, char* param2, const char* message);
105
120PQS_EXPORT_API size_t pqs_interpreter_file_to_stream(uint8_t* result, size_t reslen, const char* parameter);
121
133PQS_EXPORT_API size_t pqs_interpreter_file_buffer_length(const char* parameter);
134
149PQS_EXPORT_API size_t pqs_interpreter_stream_to_file(uint8_t* result, size_t reslen, const char* parameter, size_t parlen);
150
164PQS_EXPORT_API size_t pqs_interpreter_command_execute(char* result, size_t reslen, const char* parameter);
165
176PQS_EXPORT_API bool pqs_interpreter_initialize();
177
185PQS_EXPORT_API void pqs_interpreter_cleanup();
186
187#endif
PQS_EXPORT_API size_t pqs_interpreter_command_execute(char *result, size_t reslen, const char *parameter)
Execute a command and return its output.
Definition interpreter.c:242
PQS_EXPORT_API size_t pqs_interpreter_file_to_stream(uint8_t *result, size_t reslen, const char *parameter)
Copy a file to a byte array.
Definition interpreter.c:117
PQS_EXPORT_API size_t pqs_interpreter_file_buffer_length(const char *parameter)
Get the length of a file.
Definition interpreter.c:96
PQS_EXPORT_API bool pqs_interpreter_initialize()
Initialize the command interpreter.
Definition interpreter.c:183
PQS_EXPORT_API bool pqs_interpreter_extract_paramaters(char *param1, char *param2, const char *message)
Extract two parameters from a string.
Definition interpreter.c:57
PQS_EXPORT_API bool pqs_interpreter_extract_paramater(char *param, const char *message)
Extract a parameter from a string.
Definition interpreter.c:34
PQS_EXPORT_API void pqs_interpreter_cleanup()
Clean up the command interpreter.
Definition interpreter.c:347
PQS_EXPORT_API size_t pqs_interpreter_stream_to_file(uint8_t *result, size_t reslen, const char *parameter, size_t parlen)
Copy a byte stream to a file.
Definition interpreter.c:149