Bibliotheques TP RT  1.0
Bibliotheque de support pour TP/RT
message.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 dimercur
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
26 #ifndef MESSAGE_H
27 #define MESSAGE_H
28 
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <unistd.h>
32 #include <string.h>
33 
34 typedef struct {
35  char header[4];
36  void *data = NULL;
37 } MessageToMon;
38 
43 void set_msgToMon_header(MessageToMon *msg, char *header);
44 
48 void set_msgToMon_data(MessageToMon *msg, void *data);
49 
54 
58 void print_msgToMon(MessageToMon *msg);
59 
60 #endif /* MESSAGE_H */
61 
void set_msgToMon_header(MessageToMon *msg, char *header)
Set header part of monitor message.
void free_msgToMon_data(MessageToMon *msg)
Dealocate moemory pointed by data part of message.
void set_msgToMon_data(MessageToMon *msg, void *data)
Set data part of monitor message.
void print_msgToMon(MessageToMon *msg)
Print message, header and data.