Skip to content

HadrienLopes/hlibc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HLIBC (C standard library)

Objective

The main goal of this project is to provide a comprehensive C standard library that adheres to the standards defined by ISO/IEC 9899:2023.
This library aims for efficiency by prioritizing optimized algorithms and minimizing extraneous code.

Project Structure

The project is organized into separate sections, each corresponding to a specific part of the standard, such as "stdio", "stdlib", "string", etc...
There is a dedicated test directory containing test cases for each library.
All sources and headers files start with the prefix h_ to avoid conflicts with the standard C library ("libc").

📖 Wiki

For each library within this project, you can find additional documentation in the Wiki section. The wiki provides detailed information, usage examples, and any specific considerations.

How to compile

$> git clone https://github.com/HadrienLopes/hlibc.git
$> cd hlibc
$> make

How to use

To use hlibc functions:
After compiling the library.
Add the static library (libhlic.a) and the include directory to your project, and use the following command:

$> gcc main.c -I ./include -L ./ -l hlibc

Important

The library is only available in static version for the moment.

To run the test do:

$> make check

List of all libraries implementated

Note

  • ✅ - Fully implemented library.
  • 🚧 - Under construction library.
ctype ✅
int h_isalnum(int c);
int h_isalpha(int c);
int h_isblank(int c);
int h_iscntrl(int c);
int h_isdigit(int c);
int h_isgraph(int c);
int h_islower(int c);
int h_isprint(int c);
int h_ispunct(int c);
int h_isspace(int c);
int h_isupper(int c);
int h_isxdigit(int c);
int h_tolower(int c);
int h_toupper(int c);
stdlib 🚧
int  h_atoi(const char *nptr);
stdio 🚧
int h_printf(const char * restrict format, ...);
string 🚧
char  *h_strcat(char * restrict s1, const char * restrict s2);
int  h_strcmp(const char *s1, const char *s2);
char  *h_strcpy(char * restrict s1, const char * restrict s2);
char  *h_strdup(const char *s);
size_t  h_strlen(const char *s);
char  *h_strncat(char * restrict s1, const char * restrict s2, size_t n);
char  *h_strncpy(char * restrict s1, const char * restrict s2, size_t n);
char  *h_strndup(const char *s, size_t size);
char  *h_strstr(char *s1, const char *s2);
char  *h_strchr(char *s, int c);
void  *h_memccpy(void *dest, const void *src, int c, size_t n);
void  *h_memchr(const void *s, int c, size_t n);
int  h_memcmp(const void *s1, const void *s2, size_t n);
void  *h_memcpy(void *dest, const void *src, size_t n);
void  *h_memmove(void *dest, const void *src, size_t n);
void  *h_memset(void *s, int c, size_t n);
strings 🚧
void  *h_bzero(void *s, size_t n);

Releases

No releases published

Packages

No packages published