A safe file reader api.
Install the library
em list
em install
em build lib release
#include "EmeraldsReadHandler.h"
int main(void) {
char *line1;
char *line2;
struct EmeraldsReadHandler *h = read_handler_new();
if(read_handler_open(h, "file.txt")) {
line1 = read_handler_read_line();
line2 = read_handler_read_line();
}
printf("%s\n", line1);
printf("%s\n", line2);
free(line1);
free(line2);
read_handler_close(h);
}
- Add nullity checks
- Fork it (https://github.com/Oblivious-Oblivious/EmeraldsReadHandler/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- oblivious - creator and maintainer