https://github.com/elisstaaf/lazy
LazyLib - C functions I don't want to rewrite.
https://github.com/elisstaaf/lazy
c c-lib c-library lazy lib library
Last synced: 10 months ago
JSON representation
LazyLib - C functions I don't want to rewrite.
- Host: GitHub
- URL: https://github.com/elisstaaf/lazy
- Owner: ElisStaaf
- License: apache-2.0
- Created: 2024-12-16T20:57:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-13T19:06:43.000Z (10 months ago)
- Last Synced: 2025-03-13T20:25:43.848Z (10 months ago)
- Topics: c, c-lib, c-library, lazy, lib, library
- Language: C
- Homepage:
- Size: 122 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lazy
Lazy is basically just a library full of functions I'm too... Well, lazy, to write again.
With things like `try/catch` and `vectors` this surely makes it the best library for
lazy C programmers that have nothing better to do than read a README (like you!).
## History
So this thing started back in the 1800s when I was figuring out C for the first time,
I was frustrated, as C had a minimal standard library. Take that as you will, nowadays
I quite like the C standard library but back then I despised it, I wanted to create something
that you could just *use*, like this:
```c
#include
int main() {
try()
println("Hello World!");
catch()
println("NO YOU STUPID IDIOT");
return 1;
return 0;
}
```
Basically, a heaven where everything becomes easier, a world were *this*:
```c
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
```
Becomes *this*:
```c
#include /* Maybe I should
* come up with a
* better name? */
```
And thus, `lazy(.h)` was born!
## Example
```c
#include
#include
#include
#include
int main(flagargs) {
flagzone {
flag({"--debug", "-d"}) {
println("System: Debug mode activated!")
}
flag({"--die", "X_X"}) {
println("System: I'm dying nooo X_X");
return -1;
}
}
errno = 0;
try {
log(0.0);
} catch(EDOM) {
assert(errno == EDOM);
}
return 0;
}
```
## Install
```sh
git clone https://github.com/ElisStaaf/lazy
cd lazy
sudo make
echo "Enjoy!"
```