diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-07-21 15:26:32 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-07-21 15:26:32 +0200 |
| commit | 23ad79e8b41c25bb4992d103d29a17612a52e351 (patch) | |
| tree | 9de3cde07cc38e59f08885171e9f99eeab8ab71b /rush02/ex00/include.h | |
| parent | 8b6e91bdb56bc01a588718472546f2a88e750b48 (diff) | |
| download | piscine-23ad79e8b41c25bb4992d103d29a17612a52e351.tar.gz piscine-23ad79e8b41c25bb4992d103d29a17612a52e351.tar.bz2 piscine-23ad79e8b41c25bb4992d103d29a17612a52e351.zip | |
c10 done, c11 on going, rush02 probably finished, bsq start
Diffstat (limited to 'rush02/ex00/include.h')
| -rw-r--r-- | rush02/ex00/include.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/rush02/ex00/include.h b/rush02/ex00/include.h new file mode 100644 index 0000000..f50f846 --- /dev/null +++ b/rush02/ex00/include.h @@ -0,0 +1,72 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* include.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: yiacono <yiacono@student.s19.be> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/07/20 07:31:47 by cacharle #+# #+# */ +/* Updated: 2019/07/21 14:51:26 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef INCLUDE_H +# define INCLUDE_H + +# define TRUE 1 +# define FALSE 0 +# define BUF_SIZE 1024 +# define REQUIRED_SIZE 32 + +typedef long long int t_max_nbr; +struct s_entry +{ + t_max_nbr key; + char *value; +}; +typedef struct s_entry t_entry; +typedef t_entry* t_dict; +/* +** helper.c - previously made functions +*/ + +int read_file(int fildes, char **file); +char *ft_memcat(char *file, char buf[BUF_SIZE], int file_size, + int buf_size); +char *ft_strndup(char *src, int n); +void ft_putstr(char *str); + +/* +** convert.c - Convert number to string +*/ + +int convert(t_max_nbr nb, t_dict dict); + +/* +** parse.c - Dictionnary reading and converting +*/ + +t_dict parse_dict(char *file, int file_size); +t_dict parse_dict_file(char *filename); +int set_entry(char *line, t_entry *entry); +char *filtered_value(char *str); +int count_lines(char *file); + +/* +** dict.c - operation on dict +*/ + +void sort_dict(t_dict dict); +int required_values(t_dict dict); +int as_uniq_keys(t_dict dict); +void destroy_dict(t_dict dict, int size); + +/* +** error.c - Error checking +*/ + +t_max_nbr strict_atoi(char *str); +int print_error_if(int status, t_dict dict); +int print_dict_error_if(int status, t_dict dict); + +#endif |
