Library with a lot of useful C routines.
Library contains a lot of routines, just few examples:
Reads entire file into a string:
void *data;
size_t len;
if (!get_file_contents(path, &data, &len)) {
fprintf(stderr, "failed to get content of file %s\n", path);
}
free(data);
Write a string to a file:
const char *s = "Hello world!!";
if (put_file_contents("hello.txt", s, strlen(s))) {
fprintf(stderr, "failed to write string '%s' to file\n", s);
}
I want to have one place for common C routines, which can be used in my C projects.
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local ..
make install
FIND_PACKAGE(libtools)
- Maksym Kosharniy kmvvmk@gmail.com
- Oleh Kravchenko oleg@kaa.org.ua
- Ruslan Ternovyi ruslanternovy@gmail.com
Copyright (C) 2016 Oleh Kravchenko oleg@kaa.org.ua
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.