-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminitalk.h
49 lines (42 loc) · 1.58 KB
/
minitalk.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minitalk.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sleleu <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/20 16:34:13 by sleleu #+# #+# */
/* Updated: 2022/06/23 03:52:17 by sleleu ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINITALK_H
# define MINITALK_H
# include <stdio.h>
# include <unistd.h>
# include <stdlib.h>
# include <signal.h>
# include "ft_printf/ft_printf.h"
/* COLORS */
# define RED "\x1b[31m"
# define GREEN "\x1b[32m"
# define YELLOW "\x1b[33m"
# define BLUE "\x1b[34m"
# define MAGENTA "\x1b[35m"
# define CYAN "\x1b[36m"
# define END "\x1b[0m"
/* STRUCTURE */
typedef struct s_struct
{
char octet;
char *message;
pid_t client_pid;
} t_struct;
/* CLIENT */
int ft_atoi(char *str);
void ft_client_error(int i);
void ft_end_signal(int signum);
void ft_send_signal(int pid, char octet);
/* SERVER */
char *ft_charjoin(char *s1, char s2);
void ft_handler(int signum, siginfo_t *c_pid, void *tmp);
#endif