Skip to content

A collection of C header files and utility functions designed to extend the standard C library. This repository provides reusable, modular, and easy-to-integrate components to enhance productivity and code readability in C projects. Ideal for developers who want extra functionality beyond stdlib.h, string.h, and other standard headers.

License

Notifications You must be signed in to change notification settings

debeshghorui/C-Extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ C Standard Library Extensions

Supercharge your C development with battle-tested utilities and modern conveniences

Transform your C projects from basic to brilliant! This collection of carefully crafted header files and utility functions fills the gaps in the standard library, giving you the tools to write cleaner, more efficient, and more maintainable code.

C Standard Compiler Support License PRs Welcome


✨ Why C Extensions?

Stop reinventing the wheel. Every C developer has written the same utility functions dozens of times. We've collected the most essential ones into a single, well-tested library that you can drop into any project.

🎯 Perfect For:

  • System programmers building robust applications
  • Embedded developers needing lightweight utilities
  • Students learning C with modern conveniences
  • Game developers requiring high-performance helpers
  • Anyone tired of writing the same utility code repeatedly

πŸ› οΈ How to Use

🎯 Method 1: System-Wide Installation

Best for development environments where you want utilities available globally

  1. Navigate to your compiler's include directory:

    # For MinGW on Windows
    cd C:\MinGW\include
    
    # For GCC on Linux/macOS
    cd /usr/local/include
    # or
    cd /usr/include
  2. Copy the header files:

    cp /path/to/c-extensions/*.h ./
  3. Include in your projects:

    #include <your_header.h>  // Now available system-wide

πŸ“ Method 2: Project-Level Integration

Best for portable projects and team collaboration

  1. Create the recommended folder structure:

    your-project/
    β”œβ”€β”€ include/
    β”‚   β”œβ”€β”€ header1.h
    β”‚   β”œβ”€β”€ header2.h
    β”‚   └── header3.h
    β”œβ”€β”€ src/
    β”‚   └── main.c
    β”œβ”€β”€ lib/              # Optional: for .c implementation files
    β”‚   β”œβ”€β”€ impl1.c
    β”‚   └── impl2.c
    └── Makefile
    
  2. Copy headers to your include directory:

    cp /path/to/c-extensions/*.h ./include/
  3. Update your compilation command:

    gcc -I./include -o program main.c

⚑ Method 3: Direct Integration

Best for quick prototypes and single-file projects

  1. Copy desired functions directly:

    • Open the .c files from this repository
    • Copy the functions you need into your source files
    • Include any necessary headers at the top
  2. Or include headers inline:

    // Copy header content directly into your file
    #ifndef YOUR_UTILS_H
    #define YOUR_UTILS_H
    
    // Paste header content here
    
    #endif

πŸ”§ Integration Best Practices

For Header-Only Libraries:

// In your main.c or implementation file
#define IMPLEMENTATION_NAME_IMPLEMENTATION  // Enable implementation
#include "header_name.h"

For Headers with Separate Implementation:

# Compile with implementation files
gcc -I./include -o program main.c lib/impl1.c lib/impl2.c

Makefile Integration:

CC = gcc
CFLAGS = -Wall -Wextra -std=c99
INCLUDES = -I./include
SRCDIR = src
LIBDIR = lib

SOURCES = $(wildcard $(SRCDIR)/*.c) $(wildcard $(LIBDIR)/*.c)
OBJECTS = $(SOURCES:.c=.o)

program: $(OBJECTS)
	$(CC) $(OBJECTS) -o $@

%.o: %.c
	$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

πŸ§ͺ Testing Your Integration

Quick Verification:

#include <stdio.h>
#include "your_header.h"  // Your C extension header

int main() {
    printf("C Extensions loaded successfully!\n");
    
    // Test a simple function from your extensions
    // (This will depend on what's in your actual headers)
    
    return 0;
}

Compile and Test:

gcc -I./include -o test test.c
./test

πŸ’» Compatibility

Supported Compilers:

  • GCC 4.8 and later
  • Clang 3.9 and later
  • MSVC 2015 and later (with some limitations)

C Standards:

  • βœ… C89/C90 - Full compatibility
  • βœ… C99 - Full compatibility
  • βœ… C11 - Full compatibility
  • ⚠️ C17/C18 - Mostly compatible

Platforms:

  • βœ… Linux (all major distributions)
  • βœ… Windows (MinGW, MSVC, Cygwin)
  • βœ… macOS (Xcode, Homebrew GCC)
  • βœ… Embedded systems (with standard C library)

πŸš€ Getting Started

  1. Choose your integration method based on your project needs
  2. Download or clone this repository
  3. Follow the setup steps for your chosen method
  4. Start coding with enhanced C capabilities!

Next Steps:

  • Browse the header files to see available functions
  • Check the documentation for detailed API information
  • Look at example code to understand usage patterns
  • Join our community for support and updates

🀝 Contributing

We welcome contributions from developers of all skill levels!

Ways to Contribute:

  • πŸ› Bug Reports - Found something broken? Let us know!
  • πŸ’‘ Feature Requests - Have ideas for new utilities?
  • πŸ”§ Code Contributions - Submit pull requests with improvements
  • πŸ“– Documentation - Help improve guides and examples
  • πŸ§ͺ Testing - Help test on different platforms and compilers

Getting Started with Contributing:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“œ License

This project is licensed under the MIT License.

What this means:

  • βœ… Use in commercial projects
  • βœ… Modify and redistribute
  • βœ… Private use
  • βœ… No warranty or liability

Ready to enhance your C development experience?

⭐ Star this repository


Built by C developers, for C developers πŸš€

About

A collection of C header files and utility functions designed to extend the standard C library. This repository provides reusable, modular, and easy-to-integrate components to enhance productivity and code readability in C projects. Ideal for developers who want extra functionality beyond stdlib.h, string.h, and other standard headers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages