1.1 KiB
1.1 KiB
OdwetaLibC
I got bored with having to use complicated checking and stuff when working with files and arrays in C, so I implemented a new file_t struct which can load the contents of a file into a dynamically allocated array (yes, there is an implementation of those here as well... (vector_t struct)). The struct also stores the number of lines the file has.
Files
What works so far:
- Reading files into a 2D vector
- Converting a file into a string
TODO:
- File writing logic
- File appending logic
- You tell me
Vectors (dynamic arrays)
What works so far:
- Dynamically allocated arrays (vectors)
- Converting a vector into a string (has to be a
charvector) - Popping the last value of a vector and returning it
- Getting and setting a value of a vector on a given index
- Pushing a value at the end of a vector
- Inserting a value into a vector at a given index
TODO:
- Insertion of a vector into another vector
- You tell me
Installation
git clone https://gitlab.com/Odweta/odwetalibc.git
cd odwetalibc
make install
Run demo
make && ./demo