Skip to content

KaiMiyazawa/42_libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libft

42 Tokyo の課題として作成した C の自作標準ライブラリです。標準関数の挙動を再実装し、文字列・メモリ・出力・リンクリストの基礎をまとめています。

概要

  • 出力物: libft.a
  • 対象: 文字判定、文字変換、文字列処理、メモリ操作、数値変換、fd 出力
  • bonus: 汎用リンクリスト操作
  • ビルド時に -fsanitize=address を有効化しています

含まれる関数

文字判定 / 変換

  • ft_isalpha, ft_isdigit, ft_isalnum, ft_isascii, ft_isprint
  • ft_toupper, ft_tolower

文字列

  • ft_strlen, ft_strchr, ft_strrchr, ft_strncmp
  • ft_strlcpy, ft_strlcat, ft_strnstr, ft_strdup
  • ft_substr, ft_strjoin, ft_strtrim, ft_split
  • ft_itoa, ft_strmapi, ft_striteri, ft_atoi

メモリ

  • ft_memset, ft_bzero, ft_memcpy, ft_memmove
  • ft_memchr, ft_memcmp, ft_calloc

fd 出力

  • ft_putchar_fd, ft_putstr_fd, ft_putendl_fd, ft_putnbr_fd

bonus linked list

  • ft_lstnew, ft_lstadd_front, ft_lstsize, ft_lstlast
  • ft_lstadd_back, ft_lstdelone, ft_lstclear
  • ft_lstiter, ft_lstmap

ビルド

make
make bonus
make clean
make fclean
make re

使い方

#include "libft.h"

int main(void)
{
    char *s = ft_strdup("Hello, libft!");
    ft_putstr_fd(s, 1);
    free(s);
    return 0;
}
gcc -Wall -Wextra -Werror your_program.c -L. -lft

ねらい

  • 標準ライブラリの実装理解
  • NULL や境界値を含むエッジケースの扱い
  • Makefile を含む C プロジェクトの基礎設計

About

42Tokyo libft project: custom implementations of standard C library functions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors