PQS: Post Quantum Shell 1.0.0.0a (A1)
A quantum safe shell application
|
PQS logging functions. More...
#include "common.h"
Go to the source code of this file.
Macros | |
#define | PQS_LOGGING_MESSAGE_MAX 256 |
The maximum length of a logging message. | |
Functions | |
bool | pqs_logger_exists (void) |
Test if the log file exists. | |
void | pqs_logger_initialize (const char *path) |
Initialize the logger. | |
void | pqs_logger_print (void) |
Print the log file. | |
void | pqs_logger_read (char *output, size_t otplen) |
Read the contents of the log file. | |
void | pqs_logger_reset (void) |
Reset the logger. | |
size_t | pqs_logger_size (void) |
Get the log file size. | |
bool | pqs_logger_write (const char *message) |
Write a message to the log file. | |
bool | pqs_logger_test (void) |
Perform a manual test of the logger functions. | |
PQS logging functions.
This header defines the internal logging functions used by the PQS protocol implementation. The logger provides capabilities for initializing, writing, reading, printing, and resetting the log file. It also includes functions for checking the existence of the log file and for performing a self-test of the logger functionality.
#define PQS_LOGGING_MESSAGE_MAX 256 |
The maximum length of a logging message.
This macro defines the maximum number of characters allowed in a single log message.
bool pqs_logger_exists | ( | void | ) |
Test if the log file exists.
This function checks whether the log file exists in the default or specified path.
void pqs_logger_initialize | ( | const char * | path | ) |
Initialize the logger.
This function initializes the logging system by setting up the log file path and creating the log file if it does not already exist. The provided path is used as the location for the log file.
path | The log file path to be used for initialization. |
void pqs_logger_print | ( | void | ) |
Print the log file.
This function outputs the contents of the log file to the console or another standard output.
void pqs_logger_read | ( | char * | output, |
size_t | otplen ) |
Read the contents of the log file.
This function reads the log file into the provided output buffer.
output | The output array where the log file contents will be stored. |
otplen | The size (in bytes) of the output array. |
void pqs_logger_reset | ( | void | ) |
Reset the logger.
This function clears the log file by erasing all its contents, effectively resetting the logger.
size_t pqs_logger_size | ( | void | ) |
Get the log file size.
This function retrieves the size of the log file in bytes.
bool pqs_logger_test | ( | void | ) |
Perform a manual test of the logger functions.
This function executes a series of tests on the logger to verify that the logging functions (such as initialization, writing, reading, and resetting) are operating correctly.
bool pqs_logger_write | ( | const char * | message | ) |
Write a message to the log file.
This function writes the specified log message to the log file. The message should be a null-terminated string.
message | [const] The log message to be written. |