libft.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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: 2015/09/25 13:51:51 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. typedef struct s_list
  21. {
  22. void *content;
  23. size_t content_size;
  24. struct s_list *next;
  25. } t_list;
  26. void *ft_memset(void *b, int c, size_t len);
  27. void ft_bzero(void *s, size_t n);
  28. void *ft_memcpy(void *dst, const void *src, size_t n);
  29. void *ft_memccpy(void *dst, const void *src, int c, size_t n);
  30. void *ft_memmove(void *dest, const void *src, size_t n);
  31. void *ft_memchr(const void *s, int c, size_t n);
  32. int ft_memcmp(const void *s1, const void *s2, size_t n);
  33. size_t ft_strlen(char const *str);
  34. char *ft_strdup(const char *s1);
  35. char *ft_strcpy(char *dest, const char *src);
  36. char *ft_strncpy(char *dest, char *src, unsigned int n);
  37. char *ft_strcat(char *s1, const char *s2);
  38. char *ft_strncat(char *s1, const char *s2, size_t n);
  39. size_t ft_strlcat(char *dst, const char *src, size_t size);
  40. char *ft_strchr(const char *s, int c);
  41. char *ft_strrchr(const char *s, int c);
  42. char *ft_strstr(const char *s1, const char *s2);
  43. char *ft_strnstr(const char *s1, const char *s2, size_t n);
  44. int ft_strcmp(const char *s1, const char *s2);
  45. int ft_strncmp(const char *s1, const char *s2, size_t n);
  46. int ft_atoi(char *str);
  47. int ft_isalpha(int c);
  48. int ft_isdigit(int c);
  49. int ft_isalnum(int c);
  50. int ft_isascii(int c);
  51. int ft_isprint(int c);
  52. int ft_toupper(int c);
  53. int ft_tolower(int c);
  54. void *ft_memalloc(size_t size);
  55. void ft_memdel(void **ap);
  56. char *ft_strnew(size_t size);
  57. void ft_strdel(char **as);
  58. void ft_strclr(char *s);
  59. void ft_striter(char *s, void (*f)(char *));
  60. void ft_striteri(char *s, void (*f)(unsigned int, char *));
  61. char *ft_strmap(char const *s, char (*f)(char));
  62. char *ft_strmapi(char const *s, char (*f)(unsigned int, char));
  63. int ft_strequ(char const *s1, char const *s2);
  64. int ft_strnequ(char const *s1, char const *s2, size_t n);
  65. char *ft_strsub(char const *s, unsigned int start, size_t len);
  66. char *ft_strjoin(char const *s1, char const *s2);
  67. char *ft_strjoinf(char const *s1, char const *s2, int p);
  68. char *ft_strtrim(char const *s);
  69. char **ft_strsplit(char const *s, char c);
  70. int ft_tabsize(char **tab);
  71. char *ft_itoa(int n);
  72. void ft_putchar(char c);
  73. void ft_putstr(char const *s);
  74. void ft_putendl(char const *s);
  75. void ft_puttab(char **tab);
  76. void ft_putnbr(int n);
  77. void ft_putnbrn(int n);
  78. void ft_putchar_fd(char c, int fd);
  79. void ft_putstr_fd(char const *s, int fd);
  80. void ft_putendl_fd(char const *s, int fd);
  81. void ft_putnbr_fd(int n, int fd);
  82. t_list *ft_lstnew(void const *content, size_t content_size);
  83. void ft_lstdelone(t_list **alst, void (*del)(void*, size_t));
  84. void ft_lstdel(t_list **alst, void (*del)(void*, size_t));
  85. void ft_lstadd(t_list **alst, t_list *new);
  86. void ft_lstiter(t_list *lst, void (*f)(t_list *elem));
  87. t_list *ft_lstmap(t_list *lst, t_list *(*f)(t_list *elem));
  88. #endif