gosl/src/msg.h

26 lines
614 B
C
Raw Normal View History

2013-11-02 17:51:43 +01:00
//typedef struct Buffer {
// int size;
// void *data;
//} Buffer;
2013-11-02 17:51:43 +01:00
2013-11-02 14:44:17 +01:00
struct message {
2013-11-02 17:29:41 +01:00
uint32_t timestamp;
uint32_t width; // varies
2013-11-02 17:51:43 +01:00
uint32_t height; // normally 80
2013-11-02 17:29:41 +01:00
//char **image; // dimension is width x height
2013-11-02 17:20:34 +01:00
char *image; // dimension is width x height
2013-11-02 14:44:17 +01:00
};
2013-11-02 17:51:43 +01:00
int getBufferSize(struct message *msg);
void serialize(char *buf,struct message *msg);
void deserialize(struct message *msg,const char *buf);
/*
2013-11-02 17:51:43 +01:00
struct Buffer *new_buffer();
void append_space(Buffer *b,int n);
void serialize_int(int x,Buffer *b);
void serialize_string(char *str,Buffer *b);
void serialize_message(struct message *msg,Buffer *b);
*/