/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   libft.h                                            :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: bchanot <bchanot@students.42.fr>           +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2015/09/09 20:40:59 by bchanot           #+#    #+#             */
/*   Updated: 2018/10/29 12:16:55 by bchanot          ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#ifndef LIBFT_H
# define LIBFT_H
# define BUFF_SIZE 8

# include "ft_defs.h"
# include <wchar.h>

char		*ft_strreplace(const char *src, const char *var, const char *val);
int			ft_printf(int fd, const char *format, ...);
int			ft_isalpha(int c);
int			ft_isdigit(int c);
int			ft_isnum(const char *s);
int			ft_isascii(int c);
int			ft_isprint(int c);
int			ft_isalnum(int c);
int			ft_isupper(int c);
int			ft_isupper(int c);

int			ft_toupper(int c);
int			ft_tolower(int c);
char		*ft_strstr(const char *s1, const char *s2);
char		*ft_strnstr(const char *const s1, const char *const s2, size_t n);
char		*ft_strchr(const char *s, int c);
char		*ft_strrchr(const char *s, int c);
size_t		ft_strichr(const char *const s, int c);
char		*ft_strcpy(char *dst, const char *src);
char		*ft_strncpy(char *dst, const char *src, size_t n);
int			ft_strcmp(const char *const s1, const char *const s2);
int			ft_strncmp(const char *const s1, const char *const s2, size_t n);
char		*ft_strcat(char *dest, const char *src);
char		*ft_strncat(char *s1, const char *const s2, size_t n);
size_t		ft_strlcat(char *dst, const char *const src, size_t size);
size_t		ft_strlen(const char *const s);
size_t		ft_tablen(char **tab);
char		*ft_strdup(const char *src);
int			ft_bzero(void *s, size_t n);
void		*ft_memset(void *b, int c, size_t len);
void		*ft_memcpy(void *dst, const void *src, size_t n);
int			ft_memcmp(const void *s1, const void *s2, size_t n);
void		*ft_memchr(const void *s, int c, size_t n);
void		*ft_memccpy(void *dst, const void *src, int c, size_t n);
void		*ft_memalloc(size_t size);
char		*ft_utoa_base(t_uint64 value, t_uint8 base);
char		*ft_itoa_base(t_int64 value, t_uint8 base);
char		*ft_utoa_base_depth(t_uint64 nb, t_uint8 base, size_t depth);
char		*ft_itoa_base_depth(t_int64 nb, t_uint8 base, size_t depth);
int			ft_atoi(const char *src);
void		ft_memdel(void **ap);
void		ft_memdel2(void ***ap);
int			ft_putchar(int c);
int			ft_putchar_fd(int c, int fd);
void		ft_putendl(const char *const s);
void		ft_putendl_fd(const char *const s, int fd);
void		ft_putstr(const char *const s);
void		ft_putstr_fd(const char *const s, int fd);
void		ft_putascii(unsigned char c);
void		ft_puthex(unsigned char c, int maj);
void		ft_puttab(char **tab);
int			ft_strequ(const char *const s1, const char *const s2);
int			ft_strnequ(const char *const s1, const char *const s2, size_t n);
char		*ft_strnew(size_t size);
char		**ft_tabnew(size_t len);
char		*ft_strsub(const char *const src, unsigned int start, size_t len);
char		*ft_strjoin(const char *s1, const char *s2);
char		*ft_strnjoin(const char *s1, const char *s2, size_t n);
char		*ft_strtrim(const char *src);
char		**ft_strsplit(const char *s, char c);
size_t		ft_cptchar(const char *src, char c);
void		ft_exit(const char *const s, int fd);
size_t		ft_sqrt(size_t nb);
char		*ft_widechar(wchar_t c);
char		*ft_widestr(wchar_t *src);
int			get_next_line(int const fd, char **line);
int			ft_getchar(int fd);
char		*ft_charjoin(const char *src, const char c);
int			ft_strcmp_end(const char *s1, const char *const s2);
int			ft_strisdigit(const char *src);
void		ft_swap(int *a, int *b);
char		*ft_strcorr(const char *const src, const char c);
size_t		ft_cptcmp(const char *const s1, const char *const s2);
char		*ft_take_last_chain(char *src);
size_t		ft_nb_word(const char *src);
char		**ft_tabjoin(char **tabl, const char *const src);
char		*ft_getenv(char **env, const char *const src);
char		**ft_tabdup(char **tabl);
size_t		ft_cptchar_glued(const char *src, char c);
void		ft_system(char *src);
void		ft_print_memory(const void *addr, size_t size);
char		*ft_dup_first_word(const char *src);
char		*ft_strmerge(char *s1, char *s2);
char		*ft_strndup(const char *src, int n);
char		**ft_take_args_begin(int ac, char **av);
char		**ft_take_opts_begin(int ac, char **av);
t_bool		ft_check_opts(char **tab, const char *opt);
char		*ft_get_file_content(int fd);
char		*ft_str_upper(char *src);
char		*ft_str_lower(char *src);
size_t		ft_pow(int a, int b);
size_t		ft_nbrlen(t_int64 nb);
size_t		ft_nbrulen(t_uint64 nb);
void		ft_putunbr_fd(t_uint64 nb, int fd);
void		ft_putnbr_fd(t_int64 nb, int fd);

#endif
