diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2017-03-18 09:29:19 +0200 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2017-03-18 09:29:19 +0200 |
| commit | 7aeef53b089272f4633cc40512296bfd884a58d4 (patch) | |
| tree | 894753ced0495f725ad8362859f88d5b61e29eb7 /src/stream.c | |
| parent | e9958e8a0f5aa5fbe0a4a03be42b8bf640add6f7 (diff) | |
| parent | 2c76b0da9e0aba2211d5b4a8e51c79e47ad9b6c8 (diff) | |
| download | mqtt-0.5.tar.gz mqtt-0.5.zip | |
Merge branch 'the-great-refactor'v0.5
* the-great-refactor:
Add big_message_test
Fix publish message serialization
Modify the code to use nonblocking sockets
Fix indentation
Free userName and password in MqttClientFree()
Add forgotten files
Massive refactoring of the internals
Diffstat (limited to 'src/stream.c')
| -rw-r--r-- | src/stream.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/stream.c b/src/stream.c index fd154a1..1c46668 100644 --- a/src/stream.c +++ b/src/stream.c @@ -47,6 +47,11 @@ int64_t StreamReadUint16Be(uint16_t *v, Stream *stream) return 2; } +int64_t StreamReadByte(unsigned char *byte, Stream *stream) +{ + return StreamRead(byte, sizeof(*byte), stream); +} + int64_t StreamWrite(const void *ptr, size_t size, Stream *stream) { STREAM_CHECK_OP(stream, write); @@ -65,6 +70,11 @@ int64_t StreamWriteUint16Be(uint16_t v, Stream *stream) return StreamWrite(data, sizeof(data), stream); } +int64_t StreamWriteByte(unsigned char byte, Stream *stream) +{ + return StreamWrite(&byte, sizeof(byte), stream); +} + int StreamSeek(Stream *stream, int64_t offset, int whence) { STREAM_CHECK_OP(stream, seek); |
