WINC - it's a set of simple and convenient cross-platform libraries for C language. A large number of different libraries will be added soon, but now the set contains the following libraries for working with:
- File system
- Utils
- Collections
- Multithreading
One of the example collection from the Utils library:
int main(int argc, char** argv)
{
list_t* list = init_list();
push_back_list(list, "world");
push_back_list(list, "!!!");
push_front_list(list, "Hello ");
FOR_EACH_LIST(iterator, list)
{
printf("%s", (char*) list_get(iterator));
}
destroy_list(list);
return EXIT_SUCCESS;
}
Example of the file system iterator from the FileSystem library:
void iteration_callback(const char* element)
{
printf("%s\n", element);
}
int main(int argc, char** argv)
{
char* user_dir = get_user_directory();
printf("Iteration in the user directory:\n");
path_iterate(user_dir, iteration_callback);
free(user_dir);
return EXIT_SUCCESS;
}
Clone a copy of the main WINC git repository by running:
git clone https://github.com/VladimirBalun/WINC.git
For building libraries you can use following script:
build.bat // for Windows
./build.sh // for UNIX-based
You also can build manually by running the following commands:
mkdir build
cd build
cmake ..
// run with your compiler
Documentation will be supplemented over time, but if you have any questions, please contact: [email protected]