https://github.com/levidurfee/lol_lib
C library for stuff I frequently do
https://github.com/levidurfee/lol_lib
Last synced: about 1 month ago
JSON representation
C library for stuff I frequently do
- Host: GitHub
- URL: https://github.com/levidurfee/lol_lib
- Owner: levidurfee
- License: other
- Created: 2016-08-13T21:35:09.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-24T00:30:20.000Z (over 9 years ago)
- Last Synced: 2025-02-27T00:50:18.580Z (over 1 year ago)
- Language: C
- Homepage: https://levi.lol/
- Size: 9.46 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# lol lib
> old code had a lot of memory leaks, so i am redoing it from scratch, testing it as i go
i've been reading books on C that will hopefully help me develop a more solid library.
## examples
```c
/* prime stuff */
size_t p_size = 256;
//char entropy[ent];
int i;
char prime[p_size];
srand(time(NULL)); // feed the machine
for(i=0;i<2;i++) {
if(l_rand_entropy(ent, entropy)) {
printf("Entropy: %s\n", entropy);
}
}
for(i=0;i<5;i++) {
l_prime(p_size, prime, 0);
printf("%s\n\n", prime);
}
```
## testing
### valgrind
```bash
clear;make clean;make;valgrind --track-origins=yes ./lol
clear;make clean;make;valgrind --suppressions=/home/levi/valgrind.suppressions ./lol
```
### top
```bash
top -b -n 1 |grep lol
```
## useful links
* http://www.thegeekstuff.com/2011/12/c-socket-programming/
* https://computing.llnl.gov/tutorials/pthreads/
* http://www.asciitable.com/index/asciifull.gif
* http://stackoverflow.com/questions/2426277/how-free-works-when-pointer-is-incremented
* http://stackoverflow.com/questions/1963780/when-should-i-use-malloc-in-c-and-when-dont-i
* http://www.cs.bu.edu/teaching/cpp/string/array-vs-ptr/
* https://wiki.openssl.org/index.php/Main_Page