1
0
pl-libs/README.md
Jonathan Hoffstadt aebd939d7d
All checks were successful
Tests / Ubuntu (push) Successful in 10s
build: 1.0
2024-11-18 19:54:54 -06:00

46 lines
2.1 KiB
Markdown

## Pilot Light Libraries
Single-file MIT licensed libraries for C/C++. These are "STB" style libraries (more info [here](https://github.com/nothings/stb)).
### Libraries
Library | Lastest Version | Category | Lines of Code | Description
--------------------- | ---- | -------- | --- | --------------------------------
**[pl_ds.h](pl_ds.h)** | 1.0 | utility | 691 | typesafe dynamic array and hash tables for C
**[pl_json.h](pl_json.h)** | 1.0 | parsing | 2067 | json reading & writing for C
**[pl_log.h](pl_log.h)** | 1.0 | utility | 1295 | small logging library for C
**[pl_math.h](pl_math.h)** | 1.0 | math | 800 | small math library for C (vectors, matrices, quaternions, etc.)
**[pl_memory.h](pl_memory.h)** | 1.0 | utility | 699 | various memory allocators for C
**[pl_profile.h](pl_profile.h)** | 1.0 | utility | 551 | small profiling library for C
**[pl_stl.h](pl_stl.h)** | 1.0 | parsing | 340 | small STL file parser
**[pl_string.h](pl_string.h)** | 1.0 | utility | 439 | string utilities for C
**[pl_test.h](pl_test.h)** | 1.0 | misc | 543 | small testing library for C
Total libraries: 9
Total lines of C code: 7425
## FAQ
### How do I use these libraries?
The idea behind single-header file libraries is that they're easy to distribute and deploy
because all the code is contained in a single file. By default, the .h files in here act as
their own header files, i.e. they declare the functions contained in the file but don't
actually result in any code getting compiled.
So in addition, you should select _exactly one_ C/C++ source file that actually instantiates
the code, preferably a file you're not editing frequently. This file should define a
specific macro (this is documented per-library) to actually enable the function definitions.
For example, to use pl_log, you should have exactly one C/C++ file that doesn't
include pl_log.h regularly, but instead does
#define PL_LOG_IMPLEMENTATION
#include "pl_log.h"
The right macro to define is pointed out right at the top of each of these libraries.
### Where is the documentation?
The documentation is included at the top of each file.