libft.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* libft.h :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2014/11/23 19:50:04 by mazimi #+# #+# */
  9. /* Updated: 2016/10/08 11:28:44 by mazimi ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #ifndef LIBFT_H
  13. # define LIBFT_H
  14. # include "get_next_line.h"
  15. # include <string.h>
  16. # include <unistd.h>
  17. # include <stdlib.h>
  18. # include <ctype.h>
  19. # include <stddef.h>
  20. # include <stdarg.h>
  21. typedef struct s_list
  22. {
  23. void *content;
  24. size_t content_size;
  25. struct s_list *next;
  26. } t_list;
  27. void *ft_memset(void *b, int c, size_t len);
  28. void ft_bzero(void *s, size_t n);
  29. void *ft_memcpy(void *dst, const void *src, size_t n);
  30. void *ft_memccpy(void *dst, const void *src, int c, size_t n);
  31. void *ft_memmove(void *dest, const void *src, size_t n);
  32. void *ft_memchr(const void *s, int c, size_t n);
  33. int ft_memcmp(const void *s1, const void *s2, size_t n);
  34. size_t ft_strlen(char const *str);
  35. char *ft_strdup(const char *s1);
  36. char *ft_strndup(const char *s1, int n);
  37. char *ft_strdup_till(char *str, char c);
  38. char *ft_strcpy(char *dest, const char *src);
  39. char *ft_strncpy(char *dest, char *src, unsigned int n);
  40. char *ft_strcat(char *s1, const char *s2);
  41. char *ft_strncat(char *s1, const char *s2, size_t n);
  42. size_t ft_strlcat(char *dst, const char *src, size_t size);
  43. char *ft_strchr(const char *s, int c);
  44. int ft_search_pos_char(const char *s1, char c);
  45. char *ft_strrchr(const char *s, int c);
  46. char *ft_strstr(const char *s1, const char *s2);
  47. char *ft_strnstr(const char *s1, const char *s2, size_t n);
  48. int ft_strcmp(const char *s1, const char *s2);
  49. int ft_strncmp(const char *s1, const char *s2, size_t n);
  50. int ft_atoi(char *str);
  51. int ft_isalpha(int c);
  52. int ft_isdigit(int c);
  53. int ft_isalnum(int c);
  54. int ft_isascii(int c);
  55. int ft_isprint(int c);
  56. int ft_isvisible(int c);
  57. int ft_toupper(int c);
  58. int ft_tolower(int c);
  59. void *ft_memalloc(size_t size);
  60. void ft_memdel(void **ap);
  61. char *ft_strnew(size_t size);
  62. void ft_strdel(char **as);
  63. char *ft_assign_free_str(char *str, char *(*f)(const char*));
  64. void ft_strclr(char *s);
  65. void ft_striter(char *s, void (*f)(char *));
  66. void ft_striteri(char *s, void (*f)(unsigned int, char *));
  67. char *ft_strmap(char const *s, char (*f)(char));
  68. char *ft_strmapi(char const *s, char (*f)(unsigned int, char));
  69. int ft_strequ(char const *s1, char const *s2);
  70. int ft_strnequ(char const *s1, char const *s2, size_t n);
  71. char *ft_strsub(char const *s, unsigned int start, size_t len);
  72. char *ft_strjoin(char const *s1, char const *s2);
  73. char *ft_strjoinf(char const *s1, char const *s2, int p);
  74. char *ft_strtrim(char const *s);
  75. char **ft_strsplit(char const *s, char c);
  76. int ft_tabsize(char **tab);
  77. void ft_tabdel(char **tabe);
  78. char *ft_itoa(int n);
  79. void ft_putchar(char c);
  80. void ft_putstr(char const *s);
  81. void ft_putendl(char const *s);
  82. void ft_puttab(char **tab);
  83. void ft_puttabint(int **tab, int len, int spaces);
  84. void ft_putnbr(int n);
  85. void ft_putnbrn(int n);
  86. void ft_putchar_fd(char c, int fd);
  87. void ft_putstr_fd(char const *s, int fd);
  88. void ft_putendl_fd(char const *s, int fd);
  89. void ft_putnbr_fd(int n, int fd);
  90. int ft_printf(const char *format, ...);
  91. int ft_dprintf(int fd, const char *format, ...);
  92. t_list *ft_lstnew(void const *content, size_t content_size);
  93. void ft_lstdelone(t_list **alst, void (*del)(void*, size_t));
  94. void ft_lstdel(t_list **alst, void (*del)(void*, size_t));
  95. void ft_lstadd(t_list **alst, t_list *new);
  96. void ft_lstiter(t_list *lst, void (*f)(t_list *elem));
  97. t_list *ft_lstmap(t_list *lst, t_list *(*f)(t_list *elem));
  98. void sort_int_tab(int *tab, unsigned int size);
  99. int count_char_str(char *str, char c);
  100. #endif