SingingCat 0
application
coms.h
1#ifndef SINGINGCAT_COMS_H
2#define SINGINGCAT_COMS_H 1
3#include "main-header.h"
4#include <platform-header.h>
5
6int encode(byte *buf, int *bufsize, struct command *com);
7int decode(byte *buf, int bufsize, struct command *com);
8
9int fieldlen_inmem(uint8_t fieldtype, uint8_t array_size);
10int fieldlen(uint8_t fieldtype, uint8_t array_elements);
11
12int add_uint64(byte *buf, int bufsize, int *offset, uint64_t value);
13int add_uint32(byte *buf, int bufsize, int *offset, uint32_t value);
14int add_uint16(byte *buf, int bufsize, int *offset, uint32_t value);
15int add_uint8(byte *buf, int bufsize, int *offset, uint32_t value);
16
17
18int get_uint64(byte *buf, int bufsize, int *pos, uint64_t *res);
19int get_uint32(byte *buf, int bufsize, int *pos, uint32_t *res);
20int get_uint16(byte *buf, int bufsize, int *pos, uint16_t *res);
21int get_uint8(byte *buf, int bufsize, int *pos, uint8_t *res);
22
23#endif