Repository navigation
π Survival Library v1.0.0
π Description
First stable release of Survival Library, a comprehensive utility library written in standard C (C99) designed to provide essential programming tools. This release includes all basic functionalities fully implemented and tested.
π¦ Release Contents
Included Files:
survivalib.a- Compiled static library (Linux x86_64)survival_lib.h- Header with all function and macro declarationsREADME.md- Complete project documentationLICENSE- MIT License
Optional:
survival_lib-v1.0.0.tar.gz- Complete compressed package with all necessary files
β¨ Implemented Features
β
Validation Module (check/)
is_alphabetic()- Check if a character is alphabeticis_alphanumeric()- Check if a character is alphanumericis_ascii()- Check if a character is in ASCII rangeis_digit()- Check if a character is a digitis_print()- Check if a character is printableis_space()- Check if a character is whitespaceis_from_set()- Check if a character belongs to a setstr_compare_n()- Compare n characters of two stringsstr_compare_all()- Compare two strings completelystr_contains()- Check if a string contains a substring
β
Conversion Module (conversion/)
int_to_str()- Convert signed integer to stringuint_to_str()- Convert unsigned integer to stringbnum_to_str()- Convert number to string in arbitrary base (2-36)float_to_str()- Convert float to string with configurable precisionstr_to_int()- Convert string to signed integerstr_to_uint()- Convert string to unsigned integerstr_to_float()- Convert string to floatto_lower()- Convert character to lowercaseto_upper()- Convert character to uppercase
β
Memory Module (memory/)
callocation()- Memory allocation with zero initializationreallocation()- Memory reallocationmem_compare()- Compare two memory blocksmem_copy()- Copy memory blocks (non-overlapping)mem_move()- Copy memory blocks (with overlapping)mem_search()- Search for a byte in a memory blockmem_set()- Set a value in a memory blockset_zero()- Initialize memory to zeromem_len()- Calculate the length of a memory block up to a delimiter
β
String Module (string/)
str_concat()- Concatenate two stringsstr_copy()- Copy a stringstr_duplicate()- Duplicate a string (dynamic allocation)str_join()- Join two strings into a new one (dynamic allocation)str_len()- Calculate the length of a stringstr_search_char()- Search for a character in a stringstr_search_rev_char()- Search for a character from the endstr_search_str()- Search for a substring within a stringstr_split()- Split a string by a delimiterstr_substring()- Extract a substringstr_trim()- Remove characters from the beginning and end of a string
β
Printing Module (printf/)
print_format()- Custom formatted printing function- Supports specifiers:
%c,%s,%d,%i,%u,%x,%X,%p,%% - Modular and extensible internal implementation
- Supports specifiers:
β
Get Next Line Module (gnl/)
get_next_line()- Read a line from a file descriptor- Support for multiple concurrent file descriptors
- Configurable buffer (BUFFER_SIZE)
- Efficient memory handling
π₯ Installation and Usage
Option 1: Direct Download
-
Download the release files:
survivalib.asurvival_lib.h
-
Place them in your project:
mkdir -p myproject/lib myproject/include
mv survivalib.a myproject/lib/
mv survival_lib.h myproject/include/- Compile your program:
gcc -o program program.c -I./include survivalib.aOption 2: Compile from source code
- Clone the repository at version v1.0.0:
git clone --branch v1.0.0 https://github.com/Alelith/survival_lib.git
cd survival_lib
# Compile
make- Place them in your project:
mkdir -p myproject/lib myproject/include
mv survivalib.a myproject/lib/
mv include/survival_lib.h myproject/include/- Compile your program:
gcc -o program program.c -I./include survivalib.aπ§ͺ Quick Usage Example
#include "survival_lib.h"
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
// Character validation
if (is_digit('5'))
print_format("'5' is a digit\n");
// Type conversion
char *num_str = int_to_str(42);
print_format("Number as string: %s\n", num_str);
free(num_str);
// String manipulation
char *duplicate = str_duplicate("Hello World");
char *uppercase = str_duplicate(duplicate);
for (int i = 0; uppercase[i]; i++)
uppercase[i] = to_upper(uppercase[i]);
print_format("Original: %s\n", duplicate);
print_format("Uppercase: %s\n", uppercase);
// String searching
char *found = str_search_str(duplicate, "World");
if (found)
print_format("Found at position: %d\n", (int)(found - duplicate));
// Memory management
int *array = callocation(5, sizeof(int));
mem_set(array, 42, 5 * sizeof(int));
// Cleanup
free(duplicate);
free(uppercase);
free(array);
return 0;
}Compile:
gcc -o example example.c survivalib.a -I.
./exampleπ§ System Requirements
| Component | Requirement |
|---|---|
| Operating System | Linux, macOS, Unix-like |
| Compiler | GCC or C99 compatible |
| Architecture | x86_64 (compiled binary) |
| Dependencies | None (standard libc only) |
Note: If you need the library for another architecture, compile it from source code.
π Documentation
Complete online documentation:
π survival_lib Documentation
Additional resources:
- README.md - Complete project documentation
- Source code - Complete repository
- Usage examples - Detailed use cases
π Known Issues
No critical bugs have been reported in this version.
Known limitations:
print_format()does not support all standard printf specifiers (in development)- Conversion functions assume valid input (without exhaustive validation)
get_next_line()requires defining BUFFER_SIZE at compilation
π Roadmap for v1.1.0
- Complete unit test suite
- Robust input validation in conversion functions
- More specifiers for
print_format()(width, precision, flags) - Multibyte string manipulation functions
- Error handling system with standardized codes
- Performance optimizations
π Changelog
[1.0.0] - 2025-11-03
β Added
- Complete character validation module (10 functions)
- Complete type conversion module (9 functions)
- Complete memory management module (9 functions)
- Complete string manipulation module (11 functions)
- Custom formatted printing module
- Get Next Line module with multi-fd support
- Complete documentation with Doxygen
- Comprehensive README with examples
- MIT License
- Makefile with targets: all, clean, fclean, re, docs
π€ Contributing
Contributions are welcome. Please:
- Fork the project
- Create a branch for your feature (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
π License
This project is licensed under the MIT License. See LICENSE file for more details.
π©βπ» Author
Lilith EstΓ©vez Boeta
π§ Contact: GitHub Β· LinkedIn
π Acknowledgments
- 42 School - Learning methodology
- GNU C Library - Implementation reference
- Doxygen Awesome CSS - Documentation theme
- Open Source Community - Inspiration and resources
π Project Statistics
- Lines of code: ~3000+
- Number of functions: 48
- Modules: 6
- Source files: 45
- Development time: 6+ months
- Test coverage: In development
β If you find this project useful, consider giving it a star on GitHub β
View repository β’ Report bug β’ Request feature