Prog
This commit is contained in:
@@ -1,60 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "dusk.h"
|
||||
|
||||
typedef int32_t errorret_t;
|
||||
#define ERROR_OK 0
|
||||
|
||||
#define ERROR_STACK_SIZE 256
|
||||
|
||||
typedef struct {
|
||||
char_t message[ERROR_STACK_SIZE + 1];
|
||||
errorret_t code;
|
||||
} errorstack_t;
|
||||
|
||||
extern errorstack_t ERROR_STACK;
|
||||
|
||||
/**
|
||||
* Pushes an error message to the error stack.
|
||||
*
|
||||
* @param message Message to push to the error stack.
|
||||
* @param ... Arguments to format the message with.
|
||||
*/
|
||||
errorret_t error(const char_t *message, ...);
|
||||
|
||||
/**
|
||||
* Pushes an error message to the error stack with a given error code.
|
||||
*
|
||||
* @param code Error code to push to the error stack.
|
||||
* @param message Message to push to the error stack.
|
||||
* @param ... Arguments to format the message with.
|
||||
*/
|
||||
errorret_t errorCode(const errorret_t code, const char_t *message, ...);
|
||||
|
||||
/**
|
||||
* Checks if an error has been pushed to the error stack.
|
||||
*
|
||||
* @return True if an error has been pushed to the error stack.
|
||||
*/
|
||||
bool_t errorCheck();
|
||||
|
||||
/**
|
||||
* Retrieves the error message from the error stack.
|
||||
*/
|
||||
const char_t * errorString();
|
||||
|
||||
/**
|
||||
* Clears the error stack.
|
||||
*/
|
||||
void errorFlush();
|
||||
|
||||
/**
|
||||
* Prints the error stack to the console. This also clears the error stack.
|
||||
*/
|
||||
errorret_t errorPrint();
|
||||
Reference in New Issue
Block a user