added basic boilerplate for pages and filled out vector documentation

This commit is contained in:
herbglitch 2024-12-31 00:58:45 -07:00
parent 7b5194dc05
commit c4e6b525e2
9 changed files with 205 additions and 10 deletions

View file

@ -2,15 +2,16 @@
*Note: this file is being actively worked on and might change during minor updates*
## About
# Basic Overview
arc/std/errno.h is used for handling errors as well as printing to debug. It defines a global `uint32_t` ::arc_errno, as well as a global `FILE` ::arc_errno_log_file. For now it just has printing errors, but in the future it is planned to have warnings and general logs added. For error logs to be printed, `ARC_DEBUG` needs to be defined when compiled.
## Basic Error Handling
# Basic Error Handling
When throwing errors, ::arc_errno should usually be set to an ARC_ERRNO_ define describing the error. After setting ::arc_errno it is strongly recommended to log that the error happened (this really helps when debugging).
Basic Example:
# Basic Example
```c
#include <arc/std/errno.h>
@ -27,11 +28,12 @@ void ARC_Example_ThrowNullError(){
}
```
## Error Handling With More Information
# Error Handling With More Information
Sometimes the error will have data that could be helpful when debugging, so there is also a log macro that can log the error with variables added. The formatting is the same as printf.
Example With Variables:
# Example With Variables
```c
#include <arc/std/errno.h>
#include <arc/std/string.h>
@ -50,11 +52,12 @@ void ARC_Example_ThrowPathError(ARC_String *path){
}
```
## Overriding Output File
# Overriding Output File
By default the logs will output to stdout, however this can has an override by defining ARC_DEBUG_LOG_STREAM_OVERRIDE
Example of Overriding Log Stream:
# Example of Overriding Log Stream:
```c
//when compiling, ARC_DEBUG_LOG_STREAM_OVERRIDE needs to be set, then just add