Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 C String Library

C Standard Testing Static Analysis Coverage

A custom implementation of the standard C <string.h> library with sprintf/sscanf support.


🎯 Overview

To avoid namespace collisions with standard libc, all functions use a c_ prefix (e.g., c_strlen, c_memcpy). The project was developed with a strict focus on memory safety, arbitrary precision math, and engineering best practices.

✨ Key Features

  • Standard Functions: Full reimplementation of <string.h> without using standard library functions internally.
  • Formatted I/O: Custom c_sprintf and c_sscanf supporting width, precision, length modifiers, and all standard specifiers.
  • Extended API: Additional utilities for string manipulation (c_to_upper, c_to_lower, c_insert, c_trim).

🛠️ Engineering Standards

This project is not just about writing code; it's about maintaining it at a production level:

  • Testing: 100% function coverage using the Check framework.
  • Memory Safety: Zero memory leaks guaranteed by Valgrind.
  • Analysis: Static analysis via Cppcheck and dynamic coverage reports via Gcov/Lcov.
  • Style: Strict formatting enforcement using Clang-format.

🚀 Quick Start

# Clone the repository
git clone https://github.com/HimeNSK/c_string_lib.git
cd c_string_lib

# Build the static library
make all

# Run unit tests
make test

📁 Advanced Makefile Targets

make clean make test make clangn make clangi make gcov

📂 Project Structure

.
├── Makefile
├── src
│   ├── c_string.h         # Header file with function prototypes
│   ├── c_string.c         # Standard string.h functions
│   ├── c_string_extra.c   # Additional custom functions
│   ├── c_sprintf.c        # sprintf implementation
│   └── c_sscanf.c         # sscanf implementation
└── tests
    ├── test_string.c
    ├── test_extra.c
    ├── test_sprintf.c
    └── test_sscanf.c

🇷🇺 Русская версия

🎯 Обзор

Кастомная реализация стандартной библиотеки C <string.h> с поддержкой sprintf/sscanf. Чтобы избежать конфликтов имен со стандартной библиотекой, все функции используют префикс c_ (например, c_strlen). Проект разработан с упором на безопасность памяти и инженерные практики.

✨ Основные возможности

  • Стандартные функции: Полная реимплементация <string.h> без использования стандартных библиотек внутри.
  • Форматированный вывод: Собственные c_sprintf и c_sscanf с поддержкой ширины, точности и модификаторов.
  • Расширенный API: Дополнительные утилиты ( c_to_upper, c_to_lower, c_insert, c_trim ).

🛠️ Инженерное качество

Проект поддерживается на уровне production-решений:

  • Тестирование: 100% покрытие функций с использованием фреймворка Check.
  • Память: Отсутствие утечек, проверяемое Valgrind.
  • Анализ: Статический анализ Cppcheck и отчеты покрытия Gcov/Lcov.
  • Стиль: Строгое форматирование кода через Clang-format.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages