X-Git-Url: https://git.ao2.it/libam7xxx.git/blobdiff_plain/c4cda76c6f02bc04d31761a54470434d8e1d60b8..5e7d217e7f1d40fbfb6bc6375421a21bd5572788:/src/serialize.h diff --git a/src/serialize.h b/src/serialize.h new file mode 100644 index 0000000..e2dd7d4 --- /dev/null +++ b/src/serialize.h @@ -0,0 +1,36 @@ +/* am7xxx - communication with AM7xxx based USB Pico Projectors and DPFs + * + * Copyright (C) 2012 Antonio Ospite + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* You can transform a serializazion block of code which uses put-* into the + * correspondent unserialization block with this vim substitution pattern: + * + * s/put_\([^(]*\)(\([^,]*\),\s*\([^)]*\))/\2 = get_\1(\3)/g + */ + +#ifndef __SERIALIZE_H +#define __SERIALIZE_H + +#include + +uint8_t get_8(uint8_t **bufferp); +uint32_t get_le32(uint8_t **bufferp); + +uint8_t *put_8(uint8_t value, uint8_t **bufferp); +uint8_t *put_le32(uint32_t value, uint8_t **bufferp); + +#endif /* __SERIALIZE_H */