MessagePack for C
fbuffer.h
Go to the documentation of this file.
1 /*
2  * MessagePack for C FILE* buffer adaptor
3  *
4  * Copyright (C) 2013 Vladimir Volodko
5  *
6  * Distributed under the Boost Software License, Version 1.0.
7  * (See accompanying file LICENSE_1_0.txt or copy at
8  * http://www.boost.org/LICENSE_1_0.txt)
9  */
10 #ifndef MSGPACK_FBUFFER_H
11 #define MSGPACK_FBUFFER_H
12 
13 #include <stdio.h>
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 
26 static inline int msgpack_fbuffer_write(void* data, const char* buf, size_t len)
27 {
28  return (len == fwrite(buf, len, 1, (FILE *)data)) ? 0 : -1;
29 }
30 
34 #ifdef __cplusplus
35 }
36 #endif
37 
38 #endif /* msgpack/fbuffer.h */
const char * data
Definition: unpack_template.h:89
const char size_t len
Definition: unpack_template.h:89