Skip to content

Releases

v1.0.0

Choose a tag to compare

@Alelith Alelith released this 03 Nov 18:19

🚀 Survival Library v1.0.0

Release
Language
Standard
License


📋 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 declarations
  • README.md - Complete project documentation
  • LICENSE - 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 alphabetic
  • is_alphanumeric() - Check if a character is alphanumeric
  • is_ascii() - Check if a character is in ASCII range
  • is_digit() - Check if a character is a digit
  • is_print() - Check if a character is printable
  • is_space() - Check if a character is whitespace
  • is_from_set() - Check if a character belongs to a set
  • str_compare_n() - Compare n characters of two strings
  • str_compare_all() - Compare two strings completely
  • str_contains() - Check if a string contains a substring

✅ Conversion Module (conversion/)

  • int_to_str() - Convert signed integer to string
  • uint_to_str() - Convert unsigned integer to string
  • bnum_to_str() - Convert number to string in arbitrary base (2-36)
  • float_to_str() - Convert float to string with configurable precision
  • str_to_int() - Convert string to signed integer
  • str_to_uint() - Convert string to unsigned integer
  • str_to_float() - Convert string to float
  • to_lower() - Convert character to lowercase
  • to_upper() - Convert character to uppercase

✅ Memory Module (memory/)

  • callocation() - Memory allocation with zero initialization
  • reallocation() - Memory reallocation
  • mem_compare() - Compare two memory blocks
  • mem_copy() - Copy memory blocks (non-overlapping)
  • mem_move() - Copy memory blocks (with overlapping)
  • mem_search() - Search for a byte in a memory block
  • mem_set() - Set a value in a memory block
  • set_zero() - Initialize memory to zero
  • mem_len() - Calculate the length of a memory block up to a delimiter

✅ String Module (string/)

  • str_concat() - Concatenate two strings
  • str_copy() - Copy a string
  • str_duplicate() - Duplicate a string (dynamic allocation)
  • str_join() - Join two strings into a new one (dynamic allocation)
  • str_len() - Calculate the length of a string
  • str_search_char() - Search for a character in a string
  • str_search_rev_char() - Search for a character from the end
  • str_search_str() - Search for a substring within a string
  • str_split() - Split a string by a delimiter
  • str_substring() - Extract a substring
  • str_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

✅ 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

  1. Download the release files:

    • survivalib.a
    • survival_lib.h
  2. Place them in your project:

mkdir -p myproject/lib myproject/include
mv survivalib.a myproject/lib/
mv survival_lib.h myproject/include/
  1. Compile your program:
gcc -o program program.c -I./include survivalib.a

Option 2: Compile from source code

  1. 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
  1. Place them in your project:
mkdir -p myproject/lib myproject/include
mv survivalib.a myproject/lib/
mv include/survival_lib.h myproject/include/
  1. 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:


🐛 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:

  1. Fork the project
  2. Create a branch for your feature (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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