-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage-private.h
More file actions
executable file
·40 lines (33 loc) · 1.17 KB
/
message-private.h
File metadata and controls
executable file
·40 lines (33 loc) · 1.17 KB
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
/*
* File: mensagem-private.h
*
* Define varias funcoes auxiliares para trabalhar com mensagens.
*
* Author: sd001 > Bruno Neves, n.º 31614
* > Vasco Orey, n.º 32550
*/
#include <sys/types.h>
#ifndef MESSAGE_PRIVATE_H
#define MESSAGE_PRIVATE_H
struct data_t;
struct entry_t;
/*
* Funções de ajuda para o message_to_string
*/
int entry_to_string(short opcode, struct entry_t *entry, char **msg_str);
int value_to_string(short opcode, struct data_t *value, char **msg_str);
int keys_to_string(short opcode, char **keys, char **msg_str);
int key_to_string(short opcode, char *key, char **msg_str);
int result_to_string(short opcode, int result, char **msg_str);
int timestamp_to_string(short opcode, long timestamp, char **msg_str);
/*
* Funções de ajuda para o string_to_message
*/
struct entry_t *string_to_entry(char *msg_str);
char *string_to_key(char *msg_str);
char **string_to_keys(char *msg_str);
struct data_t *string_to_value(char *msg_str);
long string_to_timestamp(char *msg_str);
void encode_timestamp(long timestamp, size_t *encoded_size, char **out_string);
//void encode_timestamp(long timestamp, size_t *encoded_size, char **out_string);
#endif